Browse Source

DATAJDBC-209 - Polishing.

Added a comment to explain why we have to use a Timestamp for the comparison.

Original pull request: #66.
pull/67/head
Jens Schauder 8 years ago
parent
commit
f1e36a73e1
  1. 3
      src/test/java/org/springframework/data/jdbc/repository/query/QueryAnnotationHsqlIntegrationTests.java

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

@ -196,6 +196,9 @@ public class QueryAnnotationHsqlIntegrationTests { @@ -196,6 +196,9 @@ public class QueryAnnotationHsqlIntegrationTests {
@Test // DATAJDBC-175
public void executeCustomQueryWithReturnTypeIsDate() {
// Since Timestamp extends Date the repository returns the Timestamp as it comes from the database.
// Trying to compare that to an actual Date results in non determistic results, so we have to use an actual
// Timestamp.
Date now = new Timestamp(System.currentTimeMillis());
assertThat(repository.nowWithDate()).isAfterOrEqualsTo(now);

Loading…
Cancel
Save