Skip to content

Commit

Permalink
Fix test failures due to incorrect ordering assumption
Browse files Browse the repository at this point in the history
Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Feb 14, 2024
1 parent 76528db commit 0c77e6f
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import alpine.server.filters.AuthenticationFilter;
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import net.javacrumbs.jsonunit.core.Option;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpStatus;
Expand Down Expand Up @@ -185,6 +186,7 @@ public void exportProjectAsCycloneDxInventoryTest() {

final String jsonResponse = getPlainTextBody(response);
assertThatJson(jsonResponse)
.withOptions(Option.IGNORING_ARRAY_ORDER)
.withMatcher("projectUuid", equalTo(project.getUuid().toString()))
.withMatcher("componentWithoutVulnUuid", equalTo(componentWithoutVuln.getUuid().toString()))
.withMatcher("componentWithVulnUuid", equalTo(componentWithVuln.getUuid().toString()))
Expand Down Expand Up @@ -333,6 +335,7 @@ public void exportProjectAsCycloneDxInventoryWithVulnerabilitiesTest() {

final String jsonResponse = getPlainTextBody(response);
assertThatJson(jsonResponse)
.withOptions(Option.IGNORING_ARRAY_ORDER)
.withMatcher("vulnUuid", equalTo(vulnerability.getUuid().toString()))
.withMatcher("projectUuid", equalTo(project.getUuid().toString()))
.withMatcher("componentWithoutVulnUuid", equalTo(componentWithoutVuln.getUuid().toString()))
Expand Down Expand Up @@ -526,6 +529,7 @@ public void exportProjectAsCycloneDxVdrTest() {

final String jsonResponse = getPlainTextBody(response);
assertThatJson(jsonResponse)
.withOptions(Option.IGNORING_ARRAY_ORDER)
.withMatcher("vulnUuid", equalTo(vulnerability.getUuid().toString()))
.withMatcher("projectUuid", equalTo(project.getUuid().toString()))
.withMatcher("componentWithoutVulnUuid", equalTo(componentWithoutVuln.getUuid().toString()))
Expand Down
Loading

0 comments on commit 0c77e6f

Please sign in to comment.