From 4a956481215eaedd5fa457a35853f3ef9a40578b Mon Sep 17 00:00:00 2001 From: Ivan Daschinskiy Date: Thu, 19 Oct 2023 12:02:26 +0300 Subject: [PATCH] IGNITE-20679 Fix JdbcThinCacheToJdbcDataTypesCoverageTest#testSQLTimestampDataType for jdk11 and later. (#11000) --- .../thin/JdbcThinCacheToJdbcDataTypesCoverageTest.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinCacheToJdbcDataTypesCoverageTest.java b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinCacheToJdbcDataTypesCoverageTest.java index 02cbc0906bc6d..dc03826a93984 100644 --- a/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinCacheToJdbcDataTypesCoverageTest.java +++ b/modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinCacheToJdbcDataTypesCoverageTest.java @@ -32,6 +32,7 @@ import java.time.LocalDate; import java.time.LocalDateTime; import java.time.LocalTime; +import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -61,6 +62,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; + import static org.apache.ignite.testframework.GridTestUtils.waitForCondition; /** @@ -356,9 +358,9 @@ public void tearDown() throws Exception { @Test public void testSQLTimestampDataType() throws Exception { checkBasicCacheOperations( - new Dated(Timestamp.valueOf(LocalDateTime.now()), "yyyy-MM-dd HH:mm:ss.SSS"), - new Dated(Timestamp.valueOf(LocalDateTime.now()), "yyyy-MM-dd HH:mm:ss.SSSS"), - new Dated(Timestamp.valueOf(LocalDateTime.now()), "yyyy-MM-dd HH:mm:ss.SSSSSS")); + new Dated(Timestamp.valueOf(LocalDateTime.now().truncatedTo(ChronoUnit.MILLIS)), "yyyy-MM-dd HH:mm:ss.SSS"), + new Dated(Timestamp.valueOf(LocalDateTime.now().truncatedTo(ChronoUnit.MILLIS)), "yyyy-MM-dd HH:mm:ss.SSSS"), + new Dated(Timestamp.valueOf(LocalDateTime.now().truncatedTo(ChronoUnit.MILLIS)), "yyyy-MM-dd HH:mm:ss.SSSSSS")); } /**