Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-mulligan committed Nov 6, 2023
1 parent 8fea4ee commit 498bce8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions patchfinder/src/test/java/patches/PatchFinderTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,12 @@ public void testRun2() throws IOException {
affectedProducts.put(cveId, cpeGroup);
affectedProducts.put(cveId2, cpeGroup2);

final int numPatches = PatchFinder.run(affectedProducts, PatchFinder.cveLimit);

// Call the run method and assert the expected behavior or outcome, should be 0 because they already exist in the db
if(PatchFinder.run(affectedProducts, PatchFinder.cveLimit) == 0){
success("patches already exist in the db");
}else if (PatchFinder.run(affectedProducts, PatchFinder.cveLimit) == 74) {
success("patches added to the db");
}else{
fail("patches not added to the db");
}
if(numPatches == 0) success("patches already exist in the db");
else if (numPatches == 26) success("patches added to the db");
else fail("patches not added to the db");

// Assert that the affectedProducts map is empty
assertEquals(2, affectedProducts.size());
Expand Down

0 comments on commit 498bce8

Please sign in to comment.