From 595559bf28950c645048e7000c5045803b05f045 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Fri, 7 Feb 2020 15:27:51 +0100 Subject: [PATCH] DATAJDBC-484 - Fixes a JDK dependent test failure. Beginning from JDK 10 `Instant` uses nanosecond precision which doesn't make it through the database. This caused the test to fail. This fix fixes only the test by making the assertion more lenient. Actually storing and retrieving nanosecond precision time values is a separate issue. Also reduced logging in tests again. --- .../data/jdbc/repository/JdbcRepositoryIntegrationTests.java | 4 +++- spring-data-jdbc/src/test/resources/logback.xml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java index 2195d0ca..b4c984d8 100644 --- a/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java +++ b/spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java @@ -278,7 +278,9 @@ public class JdbcRepositoryIntegrationTests { repository.saveAll(asList(first, second)); - assertThat(repository.after(now)).containsExactly(second); + assertThat(repository.after(now)) // + .extracting(DummyEntity::getName) // + .containsExactly("second"); } @Test // DATAJDBC-234 diff --git a/spring-data-jdbc/src/test/resources/logback.xml b/spring-data-jdbc/src/test/resources/logback.xml index ade0cc6e..f1bfdbaf 100644 --- a/spring-data-jdbc/src/test/resources/logback.xml +++ b/spring-data-jdbc/src/test/resources/logback.xml @@ -8,7 +8,7 @@ - +