Search in sources :

Example 1 with AstScaResults

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

the class ScaThresholdsSteps method initMock.

private void initMock() {
    setDefaultFindings();
    SCAResults scaResults = getFakeSCAResults(DEFAULT_FINDINGS_CONFIG);
    AstScaResults wrapper = new AstScaResults();
    wrapper.setScaResults(scaResults);
    when(scaClientMock.getLatestScanResults(any())).thenReturn(wrapper);
}
Also used : AstScaResults(com.checkmarx.sdk.dto.AstScaResults) SCAResults(com.checkmarx.sdk.dto.sca.SCAResults)

Example 2 with AstScaResults

use of com.checkmarx.sdk.dto.AstScaResults in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaTest method testMissingResultsCase.

/**
 * Make sure that SCA results are null in different expected cases.
 */
private void testMissingResultsCase(String projectName) {
    log.info("Checking that scaResults are null for the {} project", projectName);
    RestClientConfig config = initScaConfig(false);
    config.setProjectName(projectName);
    AstScaResults latestResults = getLatestResults(config);
    Assert.assertNotNull("scanResults must not be null.", latestResults);
    Assert.assertNull("scaResults must be null.", latestResults.getScaResults());
}
Also used : AstScaResults(com.checkmarx.sdk.dto.AstScaResults) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig)

Example 3 with AstScaResults

use of com.checkmarx.sdk.dto.AstScaResults in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaTest method getLatestScanResults_existingResults.

@Test
public void getLatestScanResults_existingResults() {
    RestClientConfig config = initScaConfig(false);
    AstScaResults latestResults = getLatestResults(config);
    verifyScanResults(latestResults);
}
Also used : AstScaResults(com.checkmarx.sdk.dto.AstScaResults) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 4 with AstScaResults

use of com.checkmarx.sdk.dto.AstScaResults in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class ScaTest method scan_localDirUpload.

@Test
public void scan_localDirUpload() throws IOException, ScannerRuntimeException {
    RestClientConfig config = initScaConfig(false);
    config.getScaConfig().setSourceLocationType(SourceLocationType.LOCAL_DIRECTORY);
    Path sourcesDir = null;
    try {
        sourcesDir = extractTestProjectFromResources();
        config.setSourceDir(sourcesDir.toString());
        AstScaResults scanResults = runScan(config);
        verifyScanResults(scanResults);
    } finally {
        deleteDir(sourcesDir);
    }
}
Also used : Path(java.nio.file.Path) AstScaResults(com.checkmarx.sdk.dto.AstScaResults) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 5 with AstScaResults

use of com.checkmarx.sdk.dto.AstScaResults in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class AstTest method scan_remotePublicRepo.

@Test
public void scan_remotePublicRepo() throws MalformedURLException {
    RestClientConfig config = getScanConfig();
    AstScanner scanner = getScanner();
    AstScaResults scanResults = scanner.scan(toSdkScanParams(config));
    validateFinalResults(scanResults);
}
Also used : AstScanner(com.checkmarx.sdk.service.scanner.AstScanner) AstScaResults(com.checkmarx.sdk.dto.AstScaResults) RestClientConfig(com.checkmarx.sdk.config.RestClientConfig) Test(org.junit.Test) CommonClientTest(com.checkmarx.sdk.service.CommonClientTest) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

AstScaResults (com.checkmarx.sdk.dto.AstScaResults)11 RestClientConfig (com.checkmarx.sdk.config.RestClientConfig)5 ScanParams (com.checkmarx.sdk.dto.ast.ScanParams)3 SCAResults (com.checkmarx.sdk.dto.sca.SCAResults)3 Test (org.junit.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 MachinaRuntimeException (com.checkmarx.flow.exception.MachinaRuntimeException)2 ScanResults (com.checkmarx.sdk.dto.ScanResults)2 ASTResults (com.checkmarx.sdk.dto.ast.ASTResults)2 MalformedURLException (java.net.MalformedURLException)2 Path (java.nio.file.Path)2 CommonClientTest (com.checkmarx.sdk.service.CommonClientTest)1 AstScanner (com.checkmarx.sdk.service.scanner.AstScanner)1 ScaScanner (com.checkmarx.sdk.service.scanner.ScaScanner)1