diff --git a/src/test/java/org/dependencytrack/resources/v1/VulnerabilityPolicyResourceTest.java b/src/test/java/org/dependencytrack/resources/v1/VulnerabilityPolicyResourceTest.java index 1e4ca8005..6bfb3c582 100644 --- a/src/test/java/org/dependencytrack/resources/v1/VulnerabilityPolicyResourceTest.java +++ b/src/test/java/org/dependencytrack/resources/v1/VulnerabilityPolicyResourceTest.java @@ -212,7 +212,7 @@ public void triggerVulnerabilityPolicyBundleSyncThreadSafetyForCreateTest() thro assertThat(responses).hasSize(50); assertThat(responses).satisfiesOnlyOnce(response -> assertThat(response.getStatus()).isEqualTo(202)); - assertThat(responses.stream().filter(response -> response.getStatus() == 409)).hasSize(49); + assertThat(responses.stream().map(Response::getStatus).filter(status -> status != 202)).containsOnly(409); } @Test @@ -222,7 +222,7 @@ public void triggerVulnerabilityPolicyBundleSyncThreadSafetyForUpdateTest() thro final ExecutorService executor = Executors.newFixedThreadPool(10); final var countDownLatch = new CountDownLatch(1); - // Create an existing workflow state that is has a terminal status. + // Create an existing workflow state that has a terminal status. // Trigger requests will reset it to a PENDING state. final WorkflowState workflowState = new WorkflowState(); workflowState.setStep(WorkflowStep.POLICY_BUNDLE_SYNC); @@ -254,7 +254,7 @@ public void triggerVulnerabilityPolicyBundleSyncThreadSafetyForUpdateTest() thro assertThat(responses).hasSize(50); assertThat(responses).satisfiesOnlyOnce(response -> assertThat(response.getStatus()).isEqualTo(202)); - assertThat(responses.stream().filter(response -> response.getStatus() == 409)).hasSize(49); + assertThat(responses.stream().map(Response::getStatus).filter(status -> status != 202)).containsOnly(409); } @Test