Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/test/java/com/checkmarx/ast/ResultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void testResultsJSON() throws Exception {
List<Scan> scanList = wrapper.scanList("statuses=Completed");
Assertions.assertTrue(scanList.size() > 0);
String scanId = scanList.get(0).getId();
String results = wrapper.results(UUID.fromString(scanId), ReportFormat.json);
String results = wrapper.results(UUID.fromString(scanId), ReportFormat.json, "java-wrapper");
Assertions.assertTrue(results.length() > 0);
}

Expand All @@ -53,9 +53,13 @@ void testResultsSummaryJSON() throws Exception {
void testResultsStructure() throws Exception {
List<Scan> scanList = wrapper.scanList("statuses=Completed");
Assertions.assertTrue(scanList.size() > 0);
String scanId = scanList.get(0).getId();
Results results = wrapper.results(UUID.fromString(scanId));
Assertions.assertEquals(results.getTotalCount(), results.getResults().size());
for (Scan scan : scanList) {
Results results = wrapper.results(UUID.fromString(scan.getId()));
if (results != null && results.getResults() != null) {
Assertions.assertEquals(results.getTotalCount(), results.getResults().size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont we want to break the loop but assert not as part of the loop? this way we will not pass the assertion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

casue as it now, it'll assert only if we are in the if. and we want to make sure that the scanned did have results

break;
}
}
}

@Test()
Expand Down