Skip to content

TestCustomMappingInstant.test_instant fails to compare Instants #227

@pgrt

Description

@pgrt

Hi,

I am working on the packaging of json-smart-v2 in Debian. I sumbled upon this test failure with version 2.5.1:

org.opentest4j.AssertionFailedError: expected: <2024-12-03T21:38:43.227Z> but was: <2024-12-03T21:38:43.227660582Z>
at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
at net.minidev.json.testMapping.TestCustomMappingInstant.test_instant(TestCustomMappingInstant.java:62)

Comparing Instants using toEpochMilli() avoids this error, but maybe this is something you would like to address.

All the best,

Pierre

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions