67
67
import java .time .ZoneId ;
68
68
import java .time .ZoneOffset ;
69
69
import java .time .ZonedDateTime ;
70
+ import java .time .temporal .ChronoUnit ;
70
71
import java .util .Date ;
71
72
import java .util .LinkedHashMap ;
72
73
import java .util .Map ;
@@ -333,7 +334,7 @@ void inetAddressArray() throws UnknownHostException {
333
334
334
335
@ Test
335
336
void instant () {
336
- testCodec (Instant .class , Instant .now (), "TIMESTAMPTZ" );
337
+ testCodec (Instant .class , Instant .now (). truncatedTo ( ChronoUnit . MICROS ) , "TIMESTAMPTZ" );
337
338
}
338
339
339
340
@ Test
@@ -441,12 +442,12 @@ void localDate() {
441
442
442
443
@ Test
443
444
void localDateTime () {
444
- testCodec (LocalDateTime .class , LocalDateTime .now (), "TIMESTAMP" );
445
+ testCodec (LocalDateTime .class , LocalDateTime .now (). truncatedTo ( ChronoUnit . MICROS ) , "TIMESTAMP" );
445
446
}
446
447
447
448
@ Test
448
449
void localTime () {
449
- testCodec (LocalTime .class , LocalTime .now (), "TIME" );
450
+ testCodec (LocalTime .class , LocalTime .now (). truncatedTo ( ChronoUnit . MICROS ) , "TIME" );
450
451
}
451
452
452
453
@ Test
@@ -472,7 +473,7 @@ void longTwoDimensionalArray() {
472
473
473
474
@ Test
474
475
void offsetDateTime () {
475
- testCodec (OffsetDateTime .class , OffsetDateTime .now (), (actual , expected ) -> assertThat (actual .isEqual (expected )).isTrue (), "TIMESTAMP WITH TIME ZONE" );
476
+ testCodec (OffsetDateTime .class , OffsetDateTime .now (). truncatedTo ( ChronoUnit . MICROS ) , (actual , expected ) -> assertThat (actual .isEqual (expected )).isTrue (), "TIMESTAMP WITH TIME ZONE" );
476
477
}
477
478
478
479
@ Test
@@ -565,16 +566,16 @@ void zoneId() {
565
566
566
567
@ Test
567
568
void zonedDateTime () {
568
- testCodec (ZonedDateTime .class , ZonedDateTime .now (), (actual , expected ) -> {
569
+ testCodec (ZonedDateTime .class , ZonedDateTime .now (). truncatedTo ( ChronoUnit . MICROS ) , (actual , expected ) -> {
569
570
assertThat (actual .toLocalDateTime ()).isEqualTo (expected .toLocalDateTime ());
570
571
}, "TIMESTAMP WITH TIME ZONE" );
571
572
}
572
573
573
574
@ Test
574
575
void offsetTime () {
575
- testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (), ZoneOffset .UTC ), "TIMETZ" );
576
- testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (), ZoneOffset .ofHoursMinutes (1 , 30 )), "TIMETZ" );
577
- testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (), ZoneOffset .ofHoursMinutes (-3 , -30 )), "TIMETZ" );
576
+ testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (). truncatedTo ( ChronoUnit . MICROS ) , ZoneOffset .UTC ), "TIMETZ" );
577
+ testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (). truncatedTo ( ChronoUnit . MICROS ) , ZoneOffset .ofHoursMinutes (1 , 30 )), "TIMETZ" );
578
+ testCodec (OffsetTime .class , OffsetTime .of (LocalTime .now (). truncatedTo ( ChronoUnit . MICROS ) , ZoneOffset .ofHoursMinutes (-3 , -30 )), "TIMETZ" );
578
579
}
579
580
580
581
@ Test
0 commit comments