From 13b1510879a8b0654b466dab33c20548af63cfee Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Mon, 30 Mar 2020 15:35:30 +0200 Subject: [PATCH] Unit test fix to work with daylight savings. Signed-off-by: Tomas Langer --- .../io/helidon/dbclient/common/mapper/MapperTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dbclient/common/src/test/java/io/helidon/dbclient/common/mapper/MapperTest.java b/dbclient/common/src/test/java/io/helidon/dbclient/common/mapper/MapperTest.java index 6d2f7b5668b..2e7766c2b09 100644 --- a/dbclient/common/src/test/java/io/helidon/dbclient/common/mapper/MapperTest.java +++ b/dbclient/common/src/test/java/io/helidon/dbclient/common/mapper/MapperTest.java @@ -20,7 +20,6 @@ import java.time.LocalDateTime; import java.time.LocalTime; import java.time.OffsetDateTime; -import java.time.ZoneOffset; import java.time.ZonedDateTime; import java.time.temporal.ChronoField; import java.util.Calendar; @@ -32,11 +31,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; -import static org.hamcrest.CoreMatchers.*; +import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; /** - * Test database types {@link Mapper}s. + * Test database types {@link io.helidon.common.mapper.Mapper}s. */ public class MapperTest { @@ -93,7 +92,8 @@ public void testSqlTimeToLocalTime() { OffsetDateTime dt = currentTime(); java.sql.Time source = new java.sql.Time(dt.toInstant().toEpochMilli()); LocalTime target = mm.map(source, java.sql.Time.class, LocalTime.class); - assertThat(target.toEpochSecond(LocalDate.EPOCH, dt.getOffset()), is(source.getTime()/1000)); + + assertThat(target, is(source.toLocalTime())); } @Test