Skip to content

Commit f511bd7

Browse files
authored
Update test to remain Java 11 forward-compatible.
Instant.now() precision changed from ms to ns since Java 11, so tests must deal with conversions to postgres μs.. [resolves #594]
1 parent f35c579 commit f511bd7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/io/r2dbc/postgresql/AbstractTemporalCodecIntegrationTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.time.OffsetDateTime;
2828
import java.time.OffsetTime;
2929
import java.time.ZoneOffset;
30+
import java.time.temporal.ChronoUnit;
3031
import java.util.TimeZone;
3132

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

204-
Instant now = Instant.now();
205+
Instant now = Instant.now().truncatedTo(ChronoUnit.MICROS);
205206
insert(now);
206207
expectValue(now);
207208
}

0 commit comments

Comments
 (0)