Skip to content

Commit e86bcb2

Browse files
AST-37667 added ability to send the agent in the results command (#322)
* AST-37667 send the agent in results command - using to display/not display the container results * AST-37667 fix test
1 parent 84641e9 commit e86bcb2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/main/java/com/checkmarx/ast/wrapper/CxWrapper.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ public Results results(@NonNull UUID scanId) throws IOException, InterruptedExce
263263

264264
public String results(@NonNull UUID scanId, ReportFormat reportFormat)
265265
throws IOException, InterruptedException, CxException {
266+
return results(scanId, reportFormat, null);
267+
}
268+
public String results(@NonNull UUID scanId, ReportFormat reportFormat, String agent)
269+
throws IOException, InterruptedException, CxException {
266270
this.logger.info("Retrieving the scan result for scan id {}", scanId);
267271

268272
String tempDir = Files.createTempDirectory("cx").toAbsolutePath().toString();
@@ -274,7 +278,10 @@ public String results(@NonNull UUID scanId, ReportFormat reportFormat)
274278
arguments.add(fileName);
275279
arguments.add(CxConstants.OUTPUT_PATH);
276280
arguments.add(tempDir);
277-
281+
if (agent != null) {
282+
arguments.add(CxConstants.AGENT);
283+
arguments.add(agent);
284+
}
278285
return Execution.executeCommand(arguments,
279286
logger, tempDir,
280287
fileName + reportFormat.getExtension());

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ void testResultsStructure() throws Exception {
5555
Assertions.assertTrue(scanList.size() > 0);
5656
String scanId = scanList.get(0).getId();
5757
Results results = wrapper.results(UUID.fromString(scanId));
58-
results.getResults().stream().filter(result -> "sast".equalsIgnoreCase(result.getType())).findFirst();
5958
Assertions.assertEquals(results.getTotalCount(), results.getResults().size());
6059
}
6160

0 commit comments

Comments
 (0)