diff --git a/src/main/java/org/assertj/db/util/Values.java b/src/main/java/org/assertj/db/util/Values.java index 6c63c72a..081982a9 100644 --- a/src/main/java/org/assertj/db/util/Values.java +++ b/src/main/java/org/assertj/db/util/Values.java @@ -115,6 +115,8 @@ else if (valueType == ValueType.DATE_TIME) { return areEqual(value, DateTimeValue.from((Timestamp) expected)); } else if (expected instanceof LocalDateTime) { return areEqual(value, DateTimeValue.from((LocalDateTime) expected)); + } else if (expected instanceof LocalDate) { + return areEqual(value, DateValue.from((LocalDate) expected)); } } else { diff --git a/src/test/java/org/assertj/db/util/Values_AreEqual_Value_And_Object_Test.java b/src/test/java/org/assertj/db/util/Values_AreEqual_Value_And_Object_Test.java index 37595b39..2e2396d9 100644 --- a/src/test/java/org/assertj/db/util/Values_AreEqual_Value_And_Object_Test.java +++ b/src/test/java/org/assertj/db/util/Values_AreEqual_Value_And_Object_Test.java @@ -268,8 +268,12 @@ public void test_are_equal_for_dates() throws Exception { public void test_are_equal_for_timestamp_and_dates() throws Exception { assertThat(Values.areEqual(getValue(null, Timestamp.valueOf("2007-12-23 00:00:00.000000000")), (Object) DateValue.of(2007, 12, 23))) .isTrue(); + assertThat(Values.areEqual(getValue(null, Timestamp.valueOf("2007-12-23 00:00:00.000000000")), LocalDate.of(2007, 12, 23))) + .isTrue(); assertThat(Values.areEqual(getValue(null, Timestamp.valueOf("2007-12-23 00:00:00.000000000")), (Object) DateValue.of(2007, 1, 2))) .isFalse(); + assertThat(Values.areEqual(getValue(null, Timestamp.valueOf("2007-12-23 00:00:00.000000000")), LocalDate.of(2007, 1, 2))) + .isFalse(); assertThat(Values.areEqual(getValue(null, ""), (Object) DateValue.of(2007, 12, 23))).isFalse(); assertThat(Values.areEqual(getValue(null, Timestamp.valueOf("2007-12-23 00:00:00.000000000")), (Object) null)).isFalse();