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 committed Jun 16, 2023
1 parent f35c579 commit f511bd7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
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 f511bd7

Please sign in to comment.