Open akilkarthikeyan opened 1 month ago
JSONObject
expectedReader.read()
outputReader.read()
assertEquals()
testJSONExport()
NON_EXTENSIBLE
JSONAssert.assertEquals()
aem-core-wcm-components
openjdk 11.0.24 2024-07-16 OpenJDK Runtime Environment (build 11.0.24+8-post-Ubuntu-1ubuntu322.04) OpenJDK 64-Bit Server VM (build 11.0.24+8-post-Ubuntu-1ubuntu322.04, mixed mode, sharing)
https://github.com/adobe/aem-core-wcm-components cd aem-core-wcm-components
mvn install -pl core -am -DskipTests mvn -pl bundles/core edu.illinois:nondex-maven-plugin:2.1.7:nondex -Dtest=com.adobe.cq.wcm.core.components.internal.models.v2.PageImplTest#testPage
Issues 0 New issues 0 Accepted issues
Measures 0 Security Hotspots 0.0% Coverage on New Code 0.0% Duplication on New Code
See analysis details on SonarCloud
Description
JSONObject
returned byexpectedReader.read()
andoutputReader.read()
, thereby causing JUnit'sassertEquals()
method to potentially fail in thetestJSONExport()
method https://github.com/adobe/aem-core-wcm-components/blob/5f29cc86b17b6db36cc617805295eb951b6504a1/bundles/core/src/test/java/com/adobe/cq/wcm/core/components/internal/models/v2/PageImplTest.java#L137 https://github.com/adobe/aem-core-wcm-components/blob/5f29cc86b17b6db36cc617805295eb951b6504a1/bundles/core/src/test/java/com/adobe/cq/wcm/core/components/Utils.java#L79assertEquals()
to theNON_EXTENSIBLE
comparison mode inJSONAssert.assertEquals()
that matches all key-value pairs without the strict ordering constraintHow was this tested?
aem-core-wcm-components
SHA: 5f29cc