-
Notifications
You must be signed in to change notification settings - Fork 118
Closed
Description
Groovy script to demonstrate the problem:
@Grab(group='com.fasterxml.jackson.core', module='jackson-databind', version='2.9.10.3')
// @Grab(group='com.google.code.gson', module='gson', version='2.8.6')
@Grab(group='net.javacrumbs.json-unit', module='json-unit', version='2.17.0')
import static net.javacrumbs.jsonunit.JsonAssert.assertJsonEquals
class Test {
BigDecimal demo;
Test(BigDecimal demo) {
this.demo = demo
}
}
Test expected = new Test(new BigDecimal("2.00"))
String actual = "{ \"demo\": 2.00 }"
assertJsonEquals(expected, actual)
org.opentest4j.AssertionFailedError: JSON documents are different:
Different value found in node "demo", expected: <2> but was: <2.0>.
But why??
Using gson, it works just fine.
Metadata
Metadata
Assignees
Labels
No labels