Search in sources :

Example 16 with ScanRequest

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

the class RunPublishProcessSteps method publishIssueForUpdate.

@When("publishing same issue with different parameters")
public void publishIssueForUpdate() throws IOException, ExitThrowable, InterruptedException {
    TimeUnit.SECONDS.sleep(2);
    ScanRequest request = getScanRequestWithDefaults();
    File file = getFileFromResourcePath("cucumber/data/sample-sast-results/1-finding-updated.xml");
    innerPublishRequest(request, file);
}
Also used : ScanRequest(com.checkmarx.flow.dto.ScanRequest) File(java.io.File) When(io.cucumber.java.en.When)

Example 17 with ScanRequest

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

the class ScaCommonSteps method getBasicScanRequest.

protected ScanRequest getBasicScanRequest(String projectName, String repoWithAuth) {
    BugTracker bt = BugTracker.builder().type(BugTracker.Type.JIRA).customBean("JIRA").build();
    ScanRequest request = ScanRequest.builder().project(projectName).repoUrlWithAuth(repoWithAuth).branch("master").repoType(ScanRequest.Repository.GITHUB).bugTracker(bt).build();
    scaConfigOverrider.initScaConfig(request);
    return request;
}
Also used : ScanRequest(com.checkmarx.flow.dto.ScanRequest) BugTracker(com.checkmarx.flow.dto.BugTracker)

Example 18 with ScanRequest

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

the class ScaFiltersSteps method scanResults.

@When("SCA runs a new scan on Filters-Tests-Repo which contains 8 vulnerabilities results")
public void scanResults() {
    // scanRequest must be created after all the changes in scaProperties are done.
    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 19 with ScanRequest

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

the class JiraLoadTestSteps method internalPublishResults.

private void internalPublishResults() throws ExitThrowable, IOException {
    ScanRequest request = getScanRequestWithDefaults();
    File file = publishUtils.getFileFromResourcePath(filename);
    StopWatch stopWatch = new StopWatch();
    stopWatch.start();
    publishUtils.publishRequest(request, file, BugTracker.Type.JIRA, sastScanner);
    stopWatch.stop();
    durations.add(stopWatch.getTime());
}
Also used : ScanRequest(com.checkmarx.flow.dto.ScanRequest) File(java.io.File) StopWatch(org.apache.commons.lang3.time.StopWatch)

Example 20 with ScanRequest

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

the class ScaPolicyManagementSteps method initNewScan.

@When("initiating a new scan")
public void initNewScan() {
    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)

Aggregations

ScanRequest (com.checkmarx.flow.dto.ScanRequest)68 BugTracker (com.checkmarx.flow.dto.BugTracker)24 ScanResults (com.checkmarx.sdk.dto.ScanResults)20 When (io.cucumber.java.en.When)14 FilterConfiguration (com.checkmarx.sdk.dto.filtering.FilterConfiguration)12 MachinaException (com.checkmarx.flow.exception.MachinaException)11 CxConfig (com.checkmarx.sdk.dto.sast.CxConfig)11 Test (org.junit.Test)11 File (java.io.File)10 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 Issue (com.checkmarx.flow.dto.Issue)5 MachinaRuntimeException (com.checkmarx.flow.exception.MachinaRuntimeException)5 IOException (java.io.IOException)5 ExecutionException (java.util.concurrent.ExecutionException)5 TimeoutException (java.util.concurrent.TimeoutException)5 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)4 IfProfileValue (org.springframework.test.annotation.IfProfileValue)4 EventResponse (com.checkmarx.flow.dto.EventResponse)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)3 FlowProperties (com.checkmarx.flow.config.FlowProperties)2