From 529e8c2f83ec11ab73d93db84298b005f01cb154 Mon Sep 17 00:00:00 2001 From: anhefti Date: Thu, 2 May 2019 16:02:37 +0200 Subject: [PATCH] fixed tests --- .../datalayer/batis/JodaTimeTypeResolverTest.java | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/test/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/JodaTimeTypeResolverTest.java b/src/test/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/JodaTimeTypeResolverTest.java index a1c50686..21029a08 100644 --- a/src/test/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/JodaTimeTypeResolverTest.java +++ b/src/test/java/ch/ethz/seb/sebserver/webservice/datalayer/batis/JodaTimeTypeResolverTest.java @@ -26,7 +26,7 @@ import org.mockito.Mockito; public class JodaTimeTypeResolverTest { @Test - public void testGetNullableResultExceptions() throws SQLException { + public void testNull() throws SQLException { final String columnName = "timestamp"; final JodaTimeTypeResolver jodaTimeTypeResolver = new JodaTimeTypeResolver(); @@ -34,14 +34,8 @@ public class JodaTimeTypeResolverTest { final ResultSet resultSetMock = Mockito.mock(ResultSet.class); when(resultSetMock.getString(columnName)).thenReturn(null); - try { - @SuppressWarnings("unused") - 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()); - } - + final DateTime nullableResult = jodaTimeTypeResolver.getNullableResult(resultSetMock, columnName); + assertNull(nullableResult); } @Test