Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Before epoch fix #132

Merged
merged 8 commits into from
Aug 30, 2019
Prev Previous commit
Next Next commit
added test for Instant prior to Instant.EPOCH is not equal after seri…
…alization deserialization issue number 120
  • Loading branch information
kupci committed Aug 27, 2019
commit 9f7a03531fbf312a00fb306fee8e8bf7e0eafb85
Original file line number Diff line number Diff line change
@@ -763,6 +763,15 @@ public void testNumericCustomPatternWithAnnotations() throws Exception
assertEquals(input.value.toInstant(), result.value.toInstant());
}

@Test
public void testInstantPriorToEpochIsEqual() throws Exception
{
final Instant original = Instant.ofEpochMilli(-1);
final String serialized = MAPPER.writeValueAsString(original);
final Instant deserialized = MAPPER.readValue(serialized, Instant.class);
assertEquals(true,original.compareTo(deserialized)==0);
}

private static void assertIsEqual(ZonedDateTime expected, ZonedDateTime actual)
{
assertTrue("The value is not correct. Expected timezone-adjusted <" + expected + ">, actual <" + actual + ">.",