6262import java .time .ZoneId ;
6363import java .time .ZoneOffset ;
6464import java .time .ZonedDateTime ;
65+ import java .time .temporal .ChronoUnit ;
6566import java .util .Date ;
6667import java .util .LinkedHashMap ;
6768import java .util .Map ;
@@ -270,7 +271,7 @@ void inetAddress() throws UnknownHostException {
270271
271272 @ Test
272273 void instant () {
273- testCodec (Instant .class , Instant .now (), "TIMESTAMPTZ" );
274+ testCodec (Instant .class , Instant .now (). truncatedTo ( ChronoUnit . MICROS ) , "TIMESTAMPTZ" );
274275 }
275276
276277 @ Test
@@ -362,12 +363,12 @@ void localDate() {
362363
363364 @ Test
364365 void localDateTime () {
365- testCodec (LocalDateTime .class , LocalDateTime .now (), "TIMESTAMP" );
366+ testCodec (LocalDateTime .class , LocalDateTime .now (). truncatedTo ( ChronoUnit . MICROS ) , "TIMESTAMP" );
366367 }
367368
368369 @ Test
369370 void localTime () {
370- testCodec (LocalTime .class , LocalTime .now (), "TIME" );
371+ testCodec (LocalTime .class , LocalTime .now (). truncatedTo ( ChronoUnit . MICROS ) , "TIME" );
371372 }
372373
373374 @ Test
@@ -393,7 +394,7 @@ void longTwoDimensionalArray() {
393394
394395 @ Test
395396 void offsetDateTime () {
396- testCodec (OffsetDateTime .class , OffsetDateTime .now (), (actual , expected ) -> assertThat (actual .isEqual (expected )).isTrue (), "TIMESTAMP WITH TIME ZONE" );
397+ testCodec (OffsetDateTime .class , OffsetDateTime .now (). truncatedTo ( ChronoUnit . MICROS ) , (actual , expected ) -> assertThat (actual .isEqual (expected )).isTrue (), "TIMESTAMP WITH TIME ZONE" );
397398 }
398399
399400 @ Test
@@ -474,16 +475,16 @@ void zoneId() {
474475
475476 @ Test
476477 void zonedDateTime () {
477- testCodec (ZonedDateTime .class , ZonedDateTime .now (), (actual , expected ) -> {
478+ testCodec (ZonedDateTime .class , ZonedDateTime .now (). truncatedTo ( ChronoUnit . MICROS ) , (actual , expected ) -> {
478479 assertThat (actual .toLocalDateTime ()).isEqualTo (expected .toLocalDateTime ());
479480 }, "TIMESTAMP WITH TIME ZONE" );
480481 }
481482
482483 @ Test
483484 void offsetTime () {
484- testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (), ZoneOffset .UTC ), "TIMETZ" );
485- testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (), ZoneOffset .ofHoursMinutes (1 , 30 )), "TIMETZ" );
486- testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (), ZoneOffset .ofHoursMinutes (-3 , -30 )), "TIMETZ" );
485+ testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (). truncatedTo ( ChronoUnit . MICROS ) , ZoneOffset .UTC ), "TIMETZ" );
486+ testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (). truncatedTo ( ChronoUnit . MICROS ) , ZoneOffset .ofHoursMinutes (1 , 30 )), "TIMETZ" );
487+ testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (). truncatedTo ( ChronoUnit . MICROS ) , ZoneOffset .ofHoursMinutes (-3 , -30 )), "TIMETZ" );
487488 }
488489
489490 @ Test
0 commit comments