use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class RunPublishProcessSteps method publishResults.
@When("publishing results to JIRA")
public void publishResults() throws ExitThrowable, IOException {
ScanRequest request = getScanRequestWithDefaults();
if (needFilter) {
request.setFilter(FilterConfiguration.fromSimpleFilters(filters));
}
File file = getFileForPublish();
innerPublishRequest(request, file);
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class GetResultsAnalyticsTestSteps method createScanRequest.
private ScanRequest createScanRequest() {
ScanRequest scanRequest = new ScanRequest();
BugTracker issueTracker = BugTracker.builder().type(BugTracker.Type.NONE).build();
scanRequest.setBugTracker(issueTracker);
scanRequest.setMergeNoteUri(MERGE_NOTE_URL);
scanRequest.setProduct(ScanRequest.Product.CX);
Map<String, String> additionalMetaData = new HashMap<>();
additionalMetaData.put("statuses_url", PULL_REQUEST_STATUSES_URL);
scanRequest.setAdditionalMetadata(additionalMetaData);
return scanRequest;
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class FlowControllerTest method testScanApiWithDefaultParamters.
@Test
public void testScanApiWithDefaultParamters() {
FlowController.CxScanRequest request = getScanRequestWithDefaults();
FlowController.CxScanRequest referenceRequest = getScanRequestWithDefaults();
referenceRequest.setFilters(getDefaultFilters());
ArgumentCaptor<ScanRequest> captor = ArgumentCaptor.forClass(ScanRequest.class);
ResponseEntity<EventResponse> response = flowController.initiateScan(request, flowProperties.getToken());
verify(flowService).initiateAutomation(captor.capture());
ScanRequest actual = captor.getValue();
assertScanRequest(actual, referenceRequest);
assertOKResponse(response);
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class FlowControllerTest method testScanApiWithFilters.
@ParameterizedTest
@MethodSource("generateDataForScanApi")
public void testScanApiWithFilters(String filterSeverity, String filterCwe, String filterOwasp, String filterType, String filterStatus, String id) {
FlowController.CxScanRequest request = getScanRequestWithDefaults();
List<Filter> filters = prepareScanApiFilters(filterSeverity, filterCwe, filterOwasp, filterType, filterStatus);
request.setFilters(filters);
ResponseEntity<EventResponse> response = flowController.initiateScan(request, flowProperties.getToken());
ArgumentCaptor<ScanRequest> captor = ArgumentCaptor.forClass(ScanRequest.class);
verify(flowService).initiateAutomation(captor.capture());
ScanRequest actual = captor.getValue();
assertScanApiFilters(actual.getFilter().getSastFilters().getSimpleFilters(), filters);
assertOKResponse(response);
}
use of com.checkmarx.flow.dto.ScanRequest in project cx-flow by checkmarx-ltd.
the class GitHubCommentsASTSteps method createScanRequest.
private ScanRequest createScanRequest() {
ScanRequest scanRequest = new ScanRequest();
scanRequest.setMergeNoteUri(MERGE_NOTE_URL);
scanRequest.setProduct(ScanRequest.Product.CX);
Map<String, String> additionalMetaData = new HashMap<>();
additionalMetaData.put("statuses_url", PULL_REQUEST_STATUSES_URL);
scanRequest.setAdditionalMetadata(additionalMetaData);
if (repo.equals(ScanRequest.Repository.GITHUB)) {
scanRequest.setRepoType(ScanRequest.Repository.GITHUB);
BugTracker issueTracker = BugTracker.builder().type(BugTracker.Type.GITHUBPULL).build();
scanRequest.setBugTracker(issueTracker);
} else {
throw new UnsupportedOperationException();
}
return scanRequest;
}
Aggregations