How to assertion the Dates

Viewed 25

I am trying to Assert the 2 dates value and getting failed as

org.opentest4j.AssertionFailedError: expected: "2022-08-17" but was: "2022-08-17 00:00:00"

i used the below code Assertions.assertThat(appointmentDate).isEqualTo(Resappdate);

1 Answers

The dates you are comparing should be in the same format.
In order to compare these date objects you need to transform the first date into the format of the second date or vise versa.

Related