-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from fasten-project/keep-purls-as-linked-hash-set
Keep purls as linked hash set to maintain ordering but preventing duplicates
- Loading branch information
Showing
8 changed files
with
30 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ | |
import java.nio.charset.StandardCharsets; | ||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.LinkedHashSet; | ||
import java.util.List; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
@@ -547,17 +548,17 @@ public void testSortingPurls() throws IOException { | |
"pkg:maven/org.apache.solr/[email protected]", | ||
"pkg:maven/org.apache.solr/[email protected]" | ||
); | ||
v.setPurls(purls); | ||
v.setPurls(new LinkedHashSet<>(purls)); | ||
|
||
vr.sortVulnerabilityPurls(v); | ||
var orderedPurls = Arrays.asList( | ||
var orderedPurls = new LinkedHashSet<>(Arrays.asList( | ||
"pkg:maven/org.apache.solr/[email protected]", | ||
"pkg:maven/org.apache.solr/[email protected]", | ||
"pkg:maven/org.apache.solr/[email protected]", | ||
"pkg:maven/org.apache.solr/[email protected]", | ||
"pkg:maven/org.apache.solr/[email protected]", | ||
"pkg:maven/org.apache.solr/[email protected]" | ||
); | ||
)); | ||
|
||
assertEquals(orderedPurls, v.getPurls()); | ||
} | ||
|