Skip to content

Commit

Permalink
Address Non-Deterministic Behavior in Unit Test (#823)
Browse files Browse the repository at this point in the history
* fix unit test
  • Loading branch information
jchen8460 authored Jun 8, 2022
1 parent d2e7cdd commit 691ad7a
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import com.sap.oss.phosphor.fosstars.model.subject.oss.MavenArtifact;
import com.sap.oss.phosphor.fosstars.model.value.ValueHashSet;
import com.sap.oss.phosphor.fosstars.model.value.Vulnerabilities;
import com.sap.oss.phosphor.fosstars.model.value.Vulnerability;
import com.sap.oss.phosphor.fosstars.util.Json;
import java.io.File;
import java.io.IOException;
Expand Down Expand Up @@ -49,8 +48,8 @@ public void testVulnerabilitiesAvailable() throws IOException {
Vulnerabilities vulnerabilities = values.of(VULNERABILITIES_IN_ARTIFACT).get().get();
assertEquals(3, vulnerabilities.size());

Vulnerability vulnerability = vulnerabilities.entries().iterator().next();
assertEquals("CVE-2018-11307", vulnerability.id());
assertTrue(vulnerabilities.entries().stream()
.anyMatch(vulnerability -> "CVE-2018-11307".equals(vulnerability.id())));
}

@Test
Expand Down

0 comments on commit 691ad7a

Please sign in to comment.