Search in sources :

Example 26 with Issue

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

the class GitLabTestUtils method mapToIssue.

private Issue mapToIssue(com.checkmarx.flow.dto.gitlab.Issue issue) {
    if (issue == null) {
        return null;
    }
    Issue i = new Issue();
    i.setBody(issue.getDescription());
    i.setTitle(issue.getTitle());
    i.setId(issue.getIid().toString());
    i.setLabels(issue.getLabels());
    i.setUrl(issue.getWebUrl());
    i.setState(issue.getState());
    return i;
}
Also used : Issue(com.checkmarx.flow.dto.Issue)

Example 27 with Issue

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

the class GitLabTestUtils method getAllProjectIssues.

private List<Issue> getAllProjectIssues(int projectId) {
    List<Issue> issues = new ArrayList<>();
    String getProjectsUrl = String.format("%s%s", gitLabProperties.getApiUrl(), GET_ISSUES_URL);
    HttpEntity<String> httpEntity = new HttpEntity<>(getHeaders());
    ResponseEntity<com.checkmarx.flow.dto.gitlab.Issue[]> response = restTemplate.exchange(getProjectsUrl, HttpMethod.GET, httpEntity, com.checkmarx.flow.dto.gitlab.Issue[].class, projectId);
    log.info("Found {} issues in project", issues.size());
    for (com.checkmarx.flow.dto.gitlab.Issue issue : response.getBody()) {
        Issue i = mapToIssue(issue);
        if (i != null) {
            issues.add(i);
        }
    }
    return issues;
}
Also used : Issue(com.checkmarx.flow.dto.Issue) ArrayList(java.util.ArrayList)

Aggregations

Issue (com.checkmarx.flow.dto.Issue)27 MachinaException (com.checkmarx.flow.exception.MachinaException)8 ArrayList (java.util.ArrayList)8 HttpClientErrorException (org.springframework.web.client.HttpClientErrorException)6 ScanRequest (com.checkmarx.flow.dto.ScanRequest)5 MachinaRuntimeException (com.checkmarx.flow.exception.MachinaRuntimeException)5 ScanResults (com.checkmarx.sdk.dto.ScanResults)5 URI (java.net.URI)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3 Test (org.junit.Test)3 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)3 FlowProperties (com.checkmarx.flow.config.FlowProperties)2 ServiceNowProperties (com.checkmarx.flow.config.ServiceNowProperties)2 IssueTracker (com.checkmarx.flow.custom.IssueTracker)2 Incident (com.checkmarx.flow.dto.servicenow.Incident)2 Result (com.checkmarx.flow.dto.servicenow.Result)2 HTMLHelper (com.checkmarx.flow.utils.HTMLHelper)2 ScanUtils (com.checkmarx.flow.utils.ScanUtils)2 Lists (com.google.common.collect.Lists)2