use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class CxConfigSteps method processScanResultsInCxFlow.
private void processScanResultsInCxFlow() throws InterruptedException {
try {
ScanRequest scanRequest = createScanRequest();
CompletableFuture<ScanResults> task = resultsService.processScanResultsAsync(scanRequest, 0, 0, null, null);
task.get(1, TimeUnit.MINUTES);
} catch (MachinaException | ExecutionException | TimeoutException e) {
String message = "Error processing scan results.";
log.error(message, e);
Assert.fail(message);
}
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class CxConfigSteps method createScanRequest.
private ScanRequest createScanRequest() {
ScanRequest scanRequest = new ScanRequest();
scanRequest.setProduct(ScanRequest.Product.CX);
scanRequest.setBugTracker(BugTracker.builder().type(BugTracker.Type.GITHUBPULL).build());
scanRequest.setMergeNoteUri(MERGE_NOTE_URL);
scanRequest.setRepoType(ScanRequest.Repository.GITHUB);
HashMap<String, String> additionalMetdata = new HashMap<>();
additionalMetdata.put("statuses_url", PULL_REQUEST_STATUSES_URL);
scanRequest.setAdditionalMetadata(additionalMetdata);
scanRequest.setThresholds(request.getThresholds());
return scanRequest;
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class RunPublishProcessSteps method publishTwoIssues.
@When("there are two existing issues")
public void publishTwoIssues() throws IOException, ExitThrowable {
ScanRequest request = getScanRequestWithDefaults();
File findingsFile = getFileFromResourcePath("cucumber/data/sample-sast-results/2-findings-different-vuln-type-different-files.xml");
innerPublishRequest(request, findingsFile);
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class PublishingSteps method publishingTheReport.
@When("^publishing (?:the|a SAST) report$")
public void publishingTheReport() throws Exception, ExitThrowable {
ScanRequest request = prepareScanRequest();
String sastReportPath = Paths.get(Constants.SAMPLE_SAST_RESULTS_DIR, sastReportFilename).toString();
File sastReport = TestUtils.getFileFromResource(sastReportPath);
try {
sastScanner.cxParseResults(request, sastReport);
} catch (Throwable e) {
if (expectingException) {
lastCxFlowException = e;
} else {
throw e;
}
}
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class GitLabServiceTest method getSources.
@IfProfileValue(name = "testprofile", value = "integration")
@Test
public void getSources() {
ScanRequest request = ScanRequest.builder().namespace("custodela-test").repoName("WebGoat").branch("develop").build();
request.setRepoProjectId(11842418);
Sources sources = service.getRepoContent(request);
assertNotNull(sources);
}
Aggregations