Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 8 additions & 1 deletion src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,10 @@ public Results results(@NonNull UUID scanId) throws IOException, InterruptedExce

public String results(@NonNull UUID scanId, ReportFormat reportFormat)
throws IOException, InterruptedException, CxException {
return results(scanId, reportFormat, null);
}
public String results(@NonNull UUID scanId, ReportFormat reportFormat, String agent)
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a private method which means the plugin will not see the new contract. I'm not sure it's the right thing to do.

throws IOException, InterruptedException, CxException {
this.logger.info("Retrieving the scan result for scan id {}", scanId);

String tempDir = Files.createTempDirectory("cx").toAbsolutePath().toString();
Expand All @@ -274,7 +278,10 @@ public String results(@NonNull UUID scanId, ReportFormat reportFormat)
arguments.add(fileName);
arguments.add(CxConstants.OUTPUT_PATH);
arguments.add(tempDir);
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's talk about the PR. Im thinking to have a default call for wrappers, as Plugins maybe


if (agent != null) {
arguments.add(CxConstants.AGENT);
arguments.add(agent);
}
return Execution.executeCommand(arguments,
logger, tempDir,
fileName + reportFormat.getExtension());
Expand Down
1 change: 0 additions & 1 deletion src/test/java/com/checkmarx/ast/ResultTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ void testResultsStructure() throws Exception {
Assertions.assertTrue(scanList.size() > 0);
String scanId = scanList.get(0).getId();
Results results = wrapper.results(UUID.fromString(scanId));
results.getResults().stream().filter(result -> "sast".equalsIgnoreCase(result.getType())).findFirst();
Assertions.assertEquals(results.getTotalCount(), results.getResults().size());
}

Expand Down