use of org.assertj.core.internal.TypeComparators in project assertj-core by joel-costigliola.
the class Objects_assertIsEqualToComparingFieldByFieldRecursive_Test method should_treat_timestamp_as_equal_to_date_when_registering_a_Date_symmetric_comparator.
@Test
public void should_treat_timestamp_as_equal_to_date_when_registering_a_Date_symmetric_comparator() {
Person actual = new Person();
actual.name = "Fred";
actual.dateOfBirth = new Timestamp(1000L);
Person other = new Person();
other.name = "Fred";
other.dateOfBirth = new Date(1000L);
TypeComparators typeComparators = new TypeComparators();
typeComparators.put(Timestamp.class, SYMMETRIC_DATE_COMPARATOR);
objects.assertIsEqualToComparingFieldByFieldRecursively(someInfo(), actual, other, noFieldComparators(), typeComparators);
objects.assertIsEqualToComparingFieldByFieldRecursively(someInfo(), other, actual, noFieldComparators(), typeComparators);
}
Aggregations