diff --git a/akka-javasdk-tests/src/test/java/akkajavasdk/ViewIntegrationTest.java b/akka-javasdk-tests/src/test/java/akkajavasdk/ViewIntegrationTest.java index 9278d871d..c31956627 100644 --- a/akka-javasdk-tests/src/test/java/akkajavasdk/ViewIntegrationTest.java +++ b/akka-javasdk-tests/src/test/java/akkajavasdk/ViewIntegrationTest.java @@ -34,6 +34,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import java.time.Instant; +import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.List; import java.util.Optional; @@ -174,7 +175,9 @@ public void verifyAllTheFieldTypesView() throws Exception { // see that we can persist and read a row with all fields, no indexed columns var id = newId(); var row = new AllTheTypesKvEntity.AllTheTypes(1, 2L, 3F, 4D, true, "text", 5, 6L, 7F, 8D, false, - Instant.now(), ZonedDateTime.now(), + Instant.now(), + // Note: we turn it into a timestamp internally, so the specific TZ is lost (but the exact point in time stays the same) + ZonedDateTime.now().withZoneSameInstant(ZoneId.of("Z")), Optional.of("optional"), List.of("text1", "text2"), new AllTheTypesKvEntity.ByEmail("test@example.com"), AllTheTypesKvEntity.AnEnum.THREE, new AllTheTypesKvEntity.Recursive(new AllTheTypesKvEntity.Recursive(null, "level2"), "level1")); diff --git a/akka-javasdk-tests/src/test/java/akkajavasdk/components/views/AllTheTypesView.java b/akka-javasdk-tests/src/test/java/akkajavasdk/components/views/AllTheTypesView.java index 8b174524a..7ec1b1822 100644 --- a/akka-javasdk-tests/src/test/java/akkajavasdk/components/views/AllTheTypesView.java +++ b/akka-javasdk-tests/src/test/java/akkajavasdk/components/views/AllTheTypesView.java @@ -81,7 +81,7 @@ public QueryEffect countRows() { } public record InstantRequest(Instant instant) {} - @Query("SELECT * FROM events WHERE instant < :instant") + @Query("SELECT * FROM events WHERE instant > :instant") public QueryStreamEffect compareInstant(InstantRequest request) { return queryStreamResult(); } public record GroupResult(List grouped, long totalCount) {}