fixed tests
This commit is contained in:
parent
e2383fa4b3
commit
529e8c2f83
1 changed files with 3 additions and 9 deletions
|
@ -26,7 +26,7 @@ import org.mockito.Mockito;
|
||||||
public class JodaTimeTypeResolverTest {
|
public class JodaTimeTypeResolverTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testGetNullableResultExceptions() throws SQLException {
|
public void testNull() throws SQLException {
|
||||||
final String columnName = "timestamp";
|
final String columnName = "timestamp";
|
||||||
|
|
||||||
final JodaTimeTypeResolver jodaTimeTypeResolver = new JodaTimeTypeResolver();
|
final JodaTimeTypeResolver jodaTimeTypeResolver = new JodaTimeTypeResolver();
|
||||||
|
@ -34,14 +34,8 @@ public class JodaTimeTypeResolverTest {
|
||||||
final ResultSet resultSetMock = Mockito.mock(ResultSet.class);
|
final ResultSet resultSetMock = Mockito.mock(ResultSet.class);
|
||||||
when(resultSetMock.getString(columnName)).thenReturn(null);
|
when(resultSetMock.getString(columnName)).thenReturn(null);
|
||||||
|
|
||||||
try {
|
final DateTime nullableResult = jodaTimeTypeResolver.getNullableResult(resultSetMock, columnName);
|
||||||
@SuppressWarnings("unused")
|
assertNull(nullableResult);
|
||||||
final DateTime nullableResult = jodaTimeTypeResolver.getNullableResult(resultSetMock, columnName);
|
|
||||||
fail("Exception expected here");
|
|
||||||
} catch (final Exception e) {
|
|
||||||
assertEquals("Failed to parse date-time from SQL string: null", e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in a new issue