use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class GetResultsAnalyticsTestSteps method getSCAResults.
@When("doing get results operation on SCA scan with {int} {int} {int} results")
public void getSCAResults(int high, int medium, int low) throws InterruptedException {
try {
scanResultsToInject = createFakeSCAScanResults(high, medium, low);
ScanRequest scanRequest = createScanRequest();
// addAdditionalInfoToResults();
// addFlowSummaryToResults(high, medium, low, info);
CompletableFuture<ScanResults> task = resultsService.processScanResultsAsync(scanRequest, PROJECT_ID, SCAN_ID, 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 GetResultsAnalyticsTestSteps method getSASTResults.
@When("doing get results operation on SAST scan with {int} {int} {int} {int} results")
public void getSASTResults(int high, int medium, int low, int info) throws InterruptedException {
try {
scanResultsToInject = createFakeSASTScanResults();
ScanRequest scanRequest = createScanRequest();
setFindingsSummary(high, medium, low, info);
addAdditionalInfoToResults();
addFlowSummaryToResults(high, medium, low, info);
CompletableFuture<ScanResults> task = resultsService.processScanResultsAsync(scanRequest, PROJECT_ID, SCAN_ID, 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 GetResultsAnalyticsTestSteps method getResultsWithFilter.
@When("doing get results operation on SAST scan with {int} {int} {int} {int} results and filter is {string}")
public void getResultsWithFilter(int high, int medium, int low, int info, String filter) throws InterruptedException {
try {
scanResultsToInject = createFakeSASTScanResults();
ScanRequest scanRequest = createScanRequest();
setFindingsSummary(high, medium, low, info, filter);
addAdditionalInfoToResults();
addFlowSummaryToResults(high, medium, low, info);
CompletableFuture<ScanResults> task = resultsService.processScanResultsAsync(scanRequest, PROJECT_ID, SCAN_ID, 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 AnalyticsSteps method createScanRequest.
private static ScanRequest createScanRequest(String repoUrl) {
ScanRequest scanRequest = new ScanRequest();
BugTracker issueTracker = BugTracker.builder().type(BugTracker.Type.GITHUBPULL).build();
scanRequest.setBugTracker(issueTracker);
scanRequest.setMergeNoteUri(MERGE_NOTE_URL);
scanRequest.setProduct(ScanRequest.Product.CX);
scanRequest.setRepoUrl(repoUrl);
HashMap<String, String> metadata = new HashMap<>();
metadata.put("statuses_url", PULL_REQUEST_STATUSES_URL);
scanRequest.setAdditionalMetadata(metadata);
return scanRequest;
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class CxConfigBugTrackerSteps method sendPushEvent.
@When("push event arrives")
public void sendPushEvent() {
assertFlowPropertiesBugTracker("Json");
ArgumentCaptor<ScanRequest> ac = ArgumentCaptor.forClass(ScanRequest.class);
FlowService flowServiceMock = Mockito.mock(FlowService.class);
gitHubControllerSpy = new GitHubController(gitHubProperties, flowProperties, jiraProperties, flowServiceMock, helperService, gitHubService, gitHubAppAuthService, filterFactory, configOverrider, scmConfigOverrider, gitAuthUrlGenerator);
gitHubControllerSpy = spy(gitHubControllerSpy);
initGitHubControllerSpy();
buildPushRequest();
verify(flowServiceMock, times(1)).initiateAutomation(ac.capture());
request = ac.getValue();
}
Aggregations