Closed glhez closed 1 month ago
Thanks, I will look into that
Please send the PR if you get to it, I will release it ASAP
Yes, will do in ~3/4 hours
@lukas-krecan I've put a PR for v2 because that's what I'm interested in. Some tests are failing in v2 branch like this one:
net.javacrumbs.jsonunit.spring.testit.KotlinDslTest.isEqualToInNodeFailIfDoesNotEqual Time elapsed: 0.01 s <<< FAILURE!
org.opentest4j.AssertionFailedError:
Expecting message to be:
"[Different value found in node "result.string"]
expected: "stringValue2"
but was: "stringValue""
but was:
"[Different value found in node "result.string"]
expected: "stringValue2"
but was: "stringValue""
Released as 3.4.1 and 2.40.1
Hello,
In our CI, Renovate tries to update JsonUnit (
net.javacrumbs.json-unit:json-unit-assertj
) from 2.38.0 to 2.40.0 and we have some unit test that fails in the updated branch, while they should not : the problem is tied to howJsonMapAssert
create itsentrySet()
and containsExactly which checks in order that all values in entries are in actual map:This fails with this message/trace:
The problem is due to the change here https://github.com/lukas-krecan/JsonUnit/compare/json-unit-parent-2.38.0...json-unit-parent-2.40.0#diff-5b83802f96066955d79fee221c4bf77f04fe03595904b2656256bf5816425cdfR235
JsonMap
extendsAbstractMap
instead ofLinkedHashMap
entrySet
usewrappedNode.fields()
like before, but the order is lost due toCollectors.toSet()
One possible solution is to use
toCollection
andLinkedHashSet
, then addCollections::unmodifiable
:If I have some time this evening, I'll try to create a PR for 2.x baseline (this probably affect 3.x)