Skip to content

Commit

Permalink
Update test to remain Java 11 forward-compatible.
Browse files Browse the repository at this point in the history
Instant.now() precision changed from ms to ns since Java 11, so tests must deal with conversions to postgres μs..

[resolves #594]
  • Loading branch information
fkomauli authored and mp911de committed Jun 16, 2023
1 parent dc5e54d commit 8ac05a8
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -27,6 +27,7 @@
import java.time.OffsetDateTime;
import java.time.OffsetTime;
import java.time.ZoneOffset;
import java.time.temporal.ChronoUnit;
import java.util.TimeZone;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -201,7 +202,7 @@ void shouldConsiderInstantMinMax() {
insert(Instant.parse("0000-12-31T01:01:00Z"));
expectValue(Instant.parse("0000-12-31T01:01:00Z"));

Instant now = Instant.now();
Instant now = Instant.now().truncatedTo(ChronoUnit.MICROS);
insert(now);
expectValue(now);
}
Expand Down

0 comments on commit 8ac05a8

Please sign in to comment.