Search in sources :

Example 21 with CxConfig

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

the class GitLabServiceTest method getCxConfig.

@IfProfileValue(name = "testprofile", value = "integration")
@Test
public void getCxConfig() {
    ScanRequest request = ScanRequest.builder().namespace("custodela-test").repoName("WebGoat").branch("develop").build();
    request.setRepoProjectId(11842418);
    CxConfig cxConfig = service.getCxConfigOverride(request);
    assertNotNull(cxConfig);
}
Also used : ScanRequest(com.checkmarx.flow.dto.ScanRequest) CxConfig(com.checkmarx.sdk.dto.sast.CxConfig) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) Test(org.junit.Test) IfProfileValue(org.springframework.test.annotation.IfProfileValue)

Example 22 with CxConfig

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

the class ScanUtils method getConfigAsCode.

public static CxConfig getConfigAsCode(String jsonConfig) {
    log.debug("Loading CxConfig: {}", jsonConfig);
    CxConfig cxConfig = null;
    ObjectMapper mapper = new ObjectMapper();
    // if override is provided, check if chars are more than 20 in length, implying base64 encoded json
    try {
        cxConfig = mapper.readValue(jsonConfig, CxConfig.class);
    } catch (IOException e) {
        log.warn("Error parsing CxConfig file: {}", ExceptionUtils.getRootCauseMessage(e));
    }
    return cxConfig;
}
Also used : CxConfig(com.checkmarx.sdk.dto.sast.CxConfig) IOException(java.io.IOException) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

CxConfig (com.checkmarx.sdk.dto.sast.CxConfig)22 ScanRequest (com.checkmarx.flow.dto.ScanRequest)11 BugTracker (com.checkmarx.flow.dto.BugTracker)6 File (java.io.File)6 Test (org.junit.Test)6 FilterConfiguration (com.checkmarx.sdk.dto.filtering.FilterConfiguration)4 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)4 IOException (java.io.IOException)4 MachinaRuntimeException (com.checkmarx.flow.exception.MachinaRuntimeException)3 JSONObject (org.json.JSONObject)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 IfProfileValue (org.springframework.test.annotation.IfProfileValue)2 CxProperties (com.checkmarx.sdk.config.CxProperties)1 ScanResults (com.checkmarx.sdk.dto.ScanResults)1 When (io.cucumber.java.en.When)1 ArrayList (java.util.ArrayList)1 HttpHeaders (org.springframework.http.HttpHeaders)1