use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.
the class ThresholdsSteps method processScanResultsInCxFlow.
private void processScanResultsInCxFlow(boolean isGitHub) {
try {
ScanRequest scanRequest = createScanRequest(isGitHub);
CompletableFuture<ScanResults> task = resultsService.processScanResultsAsync(scanRequest, 0, 0, null, null);
task.get(1, TimeUnit.MINUTES);
} catch (MachinaException | InterruptedException | ExecutionException | TimeoutException e) {
String message = "Error processing scan results.";
log.error(message, e);
Assert.fail(message);
Thread.currentThread().interrupt();
}
}
use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.
the class ThresholdsSteps method createFakeScanResults.
private static ScanResults createFakeScanResults() {
ScanResults result = new ScanResults();
result.setScanSummary(new CxScanSummary());
Map<String, Object> details = new HashMap<>();
details.put(Constants.SUMMARY_KEY, new HashMap<>());
result.setAdditionalDetails(details);
result.setXIssues(new ArrayList<>());
return result;
}
use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.
the class ScaThresholdsSteps method pull_request_should_fail.
@Then("pull request should {word}")
public void pull_request_should_fail(String expected) {
RepoProperties repoProperties = new RepoProperties();
repoProperties.setErrorMerge(true);
ScanResults scanResults = new ScanResults();
scanResults.setScaResults(scaResults);
PullRequestReport pullRequestReport = new PullRequestReport();
boolean actual = thresholdValidatorImpl.isMergeAllowed(scanResults, repoProperties, pullRequestReport);
log.info("is merged allowed = {} (expecting: {})", actual, expected);
assertEquals(expected.equals("pass"), actual, "is merged allowed = " + actual + ", but was expecting: " + expected);
}
use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.
the class CxConfigBugTrackerSteps method createFakeScanResults.
private static ScanResults createFakeScanResults() {
ScanResults result = new ScanResults();
result.setScanSummary(new CxScanSummary());
Map<String, Object> details = new HashMap<>();
details.put(Constants.SUMMARY_KEY, new HashMap<>());
result.setAdditionalDetails(details);
result.setXIssues(new ArrayList<>());
return result;
}
use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.
the class AstTicketsCreationViaJiraSteps method publishNewAstResults.
@When("publishing new known unfiltered AST results")
public void publishNewAstResults() throws IOException, MachinaException {
ScanResults scanResults = JsonUtils.json2Object(TestUtils.getFileFromRelativeResourcePath(INPUT_BASE_PATH + INPUT_FILE), ScanResults.class);
resultsService.processResults(getBasicScanRequest(), scanResults, null);
}
Aggregations