Skip to content

Commit

Permalink
Fix test issue which only shows up in java 11 (#199)
Browse files Browse the repository at this point in the history
Seems that LocalDateTime now has microseconds, so the comparison of the unconverted
and converted LocalDateTime will fail, since the conversion/mapping only retains
millisecond precision.
  • Loading branch information
davidkelly committed Jun 21, 2019
1 parent d782f57 commit 7b3352e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.junit.Assert.*;

import java.math.BigDecimal;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
Expand Down Expand Up @@ -490,7 +491,7 @@ public void writesAndReadsDates() {
DateEntity read = converter.read(DateEntity.class, converted);
assertEquals(created.getTime(), read.created.getTime());
assertEquals(modified.getTimeInMillis() / 1000, read.modified.getTimeInMillis() / 1000);
assertTrue(deleted.isEqual(read.deleted));
assertEquals(deleted.truncatedTo(ChronoUnit.MILLIS), read.deleted.truncatedTo(ChronoUnit.MILLIS));
}

@Test
Expand Down

0 comments on commit 7b3352e

Please sign in to comment.