Skip to content

Commit f1e36a7

Browse files
committed
DATAJDBC-209 - Polishing.
Added a comment to explain why we have to use a Timestamp for the comparison. Original pull request: #66.
1 parent 52a8daf commit f1e36a7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ public void executeCustomQueryWithReturnTypeIsBoolean() {
196196
@Test // DATAJDBC-175
197197
public void executeCustomQueryWithReturnTypeIsDate() {
198198

199+
// Since Timestamp extends Date the repository returns the Timestamp as it comes from the database.
200+
// Trying to compare that to an actual Date results in non determistic results, so we have to use an actual
201+
// Timestamp.
199202
Date now = new Timestamp(System.currentTimeMillis());
200203
assertThat(repository.nowWithDate()).isAfterOrEqualsTo(now);
201204

0 commit comments

Comments
 (0)