Skip to content

Commit df1a4a2

Browse files
committed
[#2187] Use adjustToDefaultPrecision in UTCNormalizedZonedTest
Replace `DateTimeUtils.roundToDefaultPrecision` with `DateTimeUtils.adjustToDefaultPrecision` This should prevent the failures we sometimes have on CI.
1 parent 39eeffe commit df1a4a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hibernate-reactive-core/src/test/java/org/hibernate/reactive/timezones/UTCNormalizedZonedTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import static org.hibernate.cfg.AvailableSettings.TIMEZONE_DEFAULT_STORAGE;
3030
import static org.hibernate.reactive.containers.DatabaseConfiguration.DBType.DB2;
3131
import static org.hibernate.reactive.testing.ReactiveAssertions.assertWithTruncationThat;
32-
import static org.hibernate.type.descriptor.DateTimeUtils.roundToDefaultPrecision;
32+
import static org.hibernate.type.descriptor.DateTimeUtils.adjustToDefaultPrecision;
3333

3434
@Timeout(value = 10, timeUnit = MINUTES)
3535
@DisabledFor(value = DB2, reason = "Exception: IllegalStateException: Needed to have 6 in buffer but only had 0")
@@ -60,10 +60,10 @@ public void test(VertxTestContext context) {
6060
.thenCompose( zid -> openSession()
6161
.thenCompose( s -> s.find( Zoned.class, zid )
6262
.thenAccept( z -> {
63-
assertWithTruncationThat( roundToDefaultPrecision( z.zonedDateTime.toInstant(), getDialect() ) )
64-
.isEqualTo( roundToDefaultPrecision( nowZoned.toInstant(), getDialect() ) );
65-
assertWithTruncationThat( roundToDefaultPrecision( z.offsetDateTime.toInstant(), getDialect() ) )
66-
.isEqualTo( roundToDefaultPrecision( nowOffset.toInstant(), getDialect() ) );
63+
assertWithTruncationThat( adjustToDefaultPrecision( z.zonedDateTime.toInstant(), getDialect() ) )
64+
.isEqualTo( adjustToDefaultPrecision( nowZoned.toInstant(), getDialect() ) );
65+
assertWithTruncationThat( adjustToDefaultPrecision( z.offsetDateTime.toInstant(), getDialect() ) )
66+
.isEqualTo( adjustToDefaultPrecision( nowOffset.toInstant(), getDialect() ) );
6767
assertThat( z.offsetDateTime.getOffset() ).isEqualTo( ZoneId.of( "Z" ) );
6868
assertThat( z.zonedDateTime.getZone() ).isEqualTo( ZoneOffset.ofHours( 0 ) );
6969
} )

0 commit comments

Comments
 (0)