Skip to content

Commit 5dccb3d

Browse files
AST-37667 fix test testResultsStructure (#325)
1 parent 58b27a8 commit 5dccb3d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/test/java/com/checkmarx/ast/ResultTest.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void testResultsJSON() throws Exception {
3636
List<Scan> scanList = wrapper.scanList("statuses=Completed");
3737
Assertions.assertTrue(scanList.size() > 0);
3838
String scanId = scanList.get(0).getId();
39-
String results = wrapper.results(UUID.fromString(scanId), ReportFormat.json);
39+
String results = wrapper.results(UUID.fromString(scanId), ReportFormat.json, "java-wrapper");
4040
Assertions.assertTrue(results.length() > 0);
4141
}
4242

@@ -53,9 +53,13 @@ void testResultsSummaryJSON() throws Exception {
5353
void testResultsStructure() throws Exception {
5454
List<Scan> scanList = wrapper.scanList("statuses=Completed");
5555
Assertions.assertTrue(scanList.size() > 0);
56-
String scanId = scanList.get(0).getId();
57-
Results results = wrapper.results(UUID.fromString(scanId));
58-
Assertions.assertEquals(results.getTotalCount(), results.getResults().size());
56+
for (Scan scan : scanList) {
57+
Results results = wrapper.results(UUID.fromString(scan.getId()));
58+
if (results != null && results.getResults() != null) {
59+
Assertions.assertEquals(results.getTotalCount(), results.getResults().size());
60+
break;
61+
}
62+
}
5963
}
6064

6165
@Test()

0 commit comments

Comments
 (0)