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;
}
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;
}
Aggregations