Search in sources :

Example 1 with CxFlowRunner

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

the class BatchComponentSteps method sastClientIsMocked.

@Given("SAST client is mocked - to allow tests to pass without active SAST environment")
public void sastClientIsMocked() throws CheckmarxException {
    when(cxClient.getTeamId(anyString())).thenReturn(ScanFixture.TEAM_ID);
    when(cxClient.getProjects(anyString())).thenReturn(ScanFixture.getProjects());
    FilterConfiguration filter = FilterConfiguration.fromSimpleFilters(ScanFixture.getScanFilters());
    when(cxClient.getReportContentByScanId(ScanFixture.SCAN_ID, filter)).thenReturn(ScanFixture.getScanResults());
    CxScannerService cxScannerService = new CxScannerService(cxProperties, null, null, null, null);
    cxFlowRunner = new CxFlowRunner(flowProperties, cxScannerService, jiraProperties, gitHubProperties, gitLabProperties, iastService, adoProperties, helperService, executors, resultsService, osaScannerService, filterFactory, configOverrider, buildProperties, scanners, thresholdValidator);
}
Also used : FilterConfiguration(com.checkmarx.sdk.dto.filtering.FilterConfiguration) CxFlowRunner(com.checkmarx.flow.CxFlowRunner) Given(io.cucumber.java.en.Given)

Example 2 with CxFlowRunner

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

the class IastCliSteps method mockCliRunner.

@Given("mock CLI runner {} {} {}")
public void mockCliRunner(String scanTag, String bugTracker, String params) {
    scanTag = removeQuotes(scanTag);
    bugTracker = removeQuotes(bugTracker);
    params = removeQuotes(params);
    cxFlowRunner = new CxFlowRunner(flowProperties, cxScannerService, jiraProperties, gitHubProperties, gitLabProperties, iastService, adoProperties, helperService, executors, resultsService, osaScannerService, filterFactory, configOverrider, buildProperties, scanners, thresholdValidator);
    String arguments = ARGS + " --scan-tag=" + scanTag + " --bug-tracker=" + bugTracker + " " + params;
    String[] argsParam = arguments.split(" ");
    this.args = new DefaultApplicationArguments(argsParam);
}
Also used : CxFlowRunner(com.checkmarx.flow.CxFlowRunner) DefaultApplicationArguments(org.springframework.boot.DefaultApplicationArguments) Given(io.cucumber.java.en.Given)

Aggregations

CxFlowRunner (com.checkmarx.flow.CxFlowRunner)2 Given (io.cucumber.java.en.Given)2 FilterConfiguration (com.checkmarx.sdk.dto.filtering.FilterConfiguration)1 DefaultApplicationArguments (org.springframework.boot.DefaultApplicationArguments)1