In case your test instantiates a date with LocalDateTime.now() , stores it into a JPA, retrieves it back, and compares, the simple assertion comparing dates might fail as the db might not support the date precision. In the example below, the assertion failed as the actual date didn’t have nanoseconds. expected: 2023-05-15T09:42:30.171983409 (java.time.LocalDateTime)
but was: 2023-05-15T09:42:30.171983 (java.time.LocalDateTime)