Search in sources :

Example 51 with ScanResults

use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.

the class PublishTicketsWithOptionalScmConfSteps method resultsProcessing.

@When("processing the results")
public void resultsProcessing() throws IOException, MachinaException {
    scanRequest = getBasicScanRequest();
    ScanResults scanResults = JsonUtils.json2Object(TestUtils.getFileFromRelativeResourcePath(INPUT_BASE_PATH + INPUT_FILE), ScanResults.class);
    resultsService.processResults(scanRequest, scanResults, null);
}
Also used : ScanResults(com.checkmarx.sdk.dto.ScanResults) When(io.cucumber.java.en.When)

Example 52 with ScanResults

use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.

the class ScaZipScanSteps method initScan.

@When("initiating a new scan")
public void initScan() {
    ScanRequest scanRequest = getBasicScanRequest(PROJECT_NAME, GIT_REPO_URL);
    ScanResults scanResults = scaScanner.scan(scanRequest);
    scaResults = Objects.requireNonNull(scanResults).getScaResults();
}
Also used : ScanRequest(com.checkmarx.flow.dto.ScanRequest) ScanResults(com.checkmarx.sdk.dto.ScanResults) When(io.cucumber.java.en.When)

Example 53 with ScanResults

use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.

the class AbstractScanSteps method callSast.

protected ScanDTO callSast() {
    ScanRequest request = generateRequest();
    try {
        scanDetails = sastScanner.executeCxScan(request, fileRepo);
        CompletableFuture<ScanResults> future = new CompletableFuture<>();
        // TODO async these, and join and merge after
        results = cxClient.getReportContentByScanId(scanDetails.getScanId(), request.getFilter());
        future.complete(results);
        results = future.join();
        errorExpected = false;
        return retainOutputValues();
    } catch (Exception e) {
        if (!errorExpected) {
            fail(e.getMessage());
        }
        return null;
    }
}
Also used : ScanRequest(com.checkmarx.flow.dto.ScanRequest) CompletableFuture(java.util.concurrent.CompletableFuture) ScanResults(com.checkmarx.sdk.dto.ScanResults)

Example 54 with ScanResults

use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.

the class ScaIssuesCreationSteps method publishNewScaResults.

@When("publishing new known unfiltered SCA results with 8 findings including 2 high and 6 medium vulnerabilities")
public void publishNewScaResults() throws IOException, MachinaException {
    ScanResults scanResults = JsonUtils.json2Object(TestUtils.getFileFromRelativeResourcePath(INPUT_BASE_PATH + INPUT_FILE), ScanResults.class);
    resultsService.processResults(getBasicScanRequest(), scanResults, null);
}
Also used : ScanResults(com.checkmarx.sdk.dto.ScanResults) When(io.cucumber.java.en.When)

Example 55 with ScanResults

use of com.checkmarx.sdk.dto.ScanResults in project cx-flow by checkmarx-ltd.

the class ScaResolveIssueSteps method processResultsByInput.

private void processResultsByInput(String inputFile) throws IOException, MachinaException {
    ScanResults scanResults = JsonUtils.json2Object(TestUtils.getFileFromRelativeResourcePath(INPUT_BASE_PATH + inputFile), ScanResults.class);
    resultsService.processResults(getBasicScanRequest(), scanResults, null);
}
Also used : ScanResults(com.checkmarx.sdk.dto.ScanResults)

Aggregations

ScanResults (com.checkmarx.sdk.dto.ScanResults)58 MachinaException (com.checkmarx.flow.exception.MachinaException)17 ScanRequest (com.checkmarx.flow.dto.ScanRequest)16 CheckmarxException (com.checkmarx.sdk.exception.CheckmarxException)14 When (io.cucumber.java.en.When)9 MachinaRuntimeException (com.checkmarx.flow.exception.MachinaRuntimeException)6 CxScanSummary (com.checkmarx.sdk.dto.cx.CxScanSummary)6 FilterConfiguration (com.checkmarx.sdk.dto.filtering.FilterConfiguration)6 ExecutionException (java.util.concurrent.ExecutionException)5 TimeoutException (java.util.concurrent.TimeoutException)5 BugTracker (com.checkmarx.flow.dto.BugTracker)4 ScanParams (com.checkmarx.sdk.dto.ast.ScanParams)4 Filter (com.checkmarx.sdk.dto.sast.Filter)4 Test (org.junit.Test)4 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)4 JiraClientException (com.checkmarx.flow.exception.JiraClientException)3 CxScanParams (com.checkmarx.sdk.dto.cx.CxScanParams)3 Finding (com.checkmarx.sdk.dto.sca.report.Finding)3 Package (com.checkmarx.sdk.dto.sca.report.Package)3 IOException (java.io.IOException)3