Java 类org.springframework.dao.UncategorizedDataAccessException 实例源码

项目:hawkbit    文件:HawkBitEclipseLinkJpaDialectTest.java   
@Test
@Description("Use Case: PersistenceException that could not be mapped by EclipseLinkJpaDialect directly but instead is wrapped"
        + " into JpaSystemException. Cause of PersistenceException is not an SQLException.")
public void jpaSystemExceptionWithNumberFormatExceptionIsNull() {
    final PersistenceException persEception = mock(PersistenceException.class);
    when(persEception.getCause()).thenReturn(new NumberFormatException());

    assertThat(hawkBitEclipseLinkJpaDialectUnderTest.translateExceptionIfPossible(persEception))
            .isInstanceOf(UncategorizedDataAccessException.class);
}