Skip to content

Commit

Permalink
Unit test fix to work with daylight savings.
Browse files Browse the repository at this point in the history
Signed-off-by: Tomas Langer <tomas.langer@oracle.com>
  • Loading branch information
tomas-langer committed Mar 30, 2020
1 parent 3d01d2d commit 13b1510
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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 {

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 13b1510

Please sign in to comment.