The issue arises while creating a custom node createDependencyNode with the specified order which doesn’t match with the order of elements initialized in the class ArtifactData.
Due to this, validating the String with another string doesn’t turn out to return true.
The fix is to use a @JsonPropertyOrder annotation to specify the order in which the properties of the ArtifactData class should always appear in the order specified.
REPRODUCE:
This was found by using the NonDex tool.
cd depgraph-maven-plugin
mvn install -am -DskipTests
mvn edu.illinois:nondex-maven-plugin2.1.7-SNAPSHOT:nondex -Dtest=com.github.ferstl.depgraph.dependency.json.JsonDependencyNodeNameRendererTest#renderArtifactIdVersion
What is the purpose of the change To address the validation issue created due to the potential variations in String ordering during comparison.
This PR aims to fix 18 tests:
REASON AND FIX:
The issue arises while creating a custom node
createDependencyNode
with the specified order which doesn’t match with the order of elements initialized in the classArtifactData
.https://github.com/ferstl/depgraph-maven-plugin/blob/f93bf3b39986dd7eafff30f5858439a9879e1618/src/test/java/com/github/ferstl/depgraph/dependency/AbstractDependencyNodeNameRendererTest.java#L56
Due to this, validating the String with another string doesn’t turn out to return true. The fix is to use a
@JsonPropertyOrder
annotation to specify the order in which the properties of the ArtifactData class should always appear in the order specified.REPRODUCE: This was found by using the NonDex tool.