Search in sources :

Example 1 with DTOFactory

use of com.hp.octane.integrations.dto.DTOFactory in project octane-ci-java-sdk by MicroFocus.

the class SonarToOctaneIssueUtil method createOctaneIssues.

public static List<OctaneIssue> createOctaneIssues(List<SonarIssue> issues, String remoteTag, String sonarUrl, Set<String> issuesRequiredExtendedDataKeys, Map<String, SonarRule> rules) {
    if (issues == null) {
        return new ArrayList<>();
    }
    DTOFactory dtoFactory = DTOFactory.getInstance();
    List<OctaneIssue> octaneIssues = new ArrayList<>();
    for (SonarIssue issue : issues) {
        OctaneIssue octaneIssue = createOctaneIssue(dtoFactory, issue, rules, sonarUrl);
        octaneIssue.setRemoteTag(remoteTag);
        octaneIssues.add(octaneIssue);
        if (issuesRequiredExtendedDataKeys.contains(issue.getKey())) {
            Map<String, String> extendedData = prepareExtendedData(issue, rules);
            octaneIssue.setExtendedData(extendedData);
            setOctaneStatus(issue, octaneIssue, true);
        } else {
            setOctaneStatus(issue, octaneIssue, false);
        }
    }
    return octaneIssues;
}
Also used : SonarIssue(com.hp.octane.integrations.services.vulnerabilities.sonar.dto.SonarIssue) DTOFactory(com.hp.octane.integrations.dto.DTOFactory) OctaneIssue(com.hp.octane.integrations.dto.securityscans.OctaneIssue)

Example 2 with DTOFactory

use of com.hp.octane.integrations.dto.DTOFactory in project octane-ci-java-sdk by MicroFocus.

the class SSCToOctaneIssueUtil method createOctaneIssues.

public static List<OctaneIssue> createOctaneIssues(List<Issues.Issue> issues, String remoteTag, Map<Integer, IssueDetails> issueDetailsById) {
    if (issues == null) {
        return new ArrayList<>();
    }
    logger.warn("SSCToOctane.createOctaneIssues");
    DTOFactory dtoFactory = DTOFactory.getInstance();
    List<OctaneIssue> octaneIssues = new ArrayList<>();
    for (Issues.Issue issue : issues) {
        OctaneIssue octaneIssue = createOctaneIssue(dtoFactory, issue, issueDetailsById.get(issue.id));
        octaneIssues.add(octaneIssue);
        octaneIssue.setRemoteTag(remoteTag);
    }
    return octaneIssues;
}
Also used : Issues(com.hp.octane.integrations.services.vulnerabilities.ssc.dto.Issues) DTOFactory(com.hp.octane.integrations.dto.DTOFactory) OctaneIssue(com.hp.octane.integrations.dto.securityscans.OctaneIssue)

Aggregations

DTOFactory (com.hp.octane.integrations.dto.DTOFactory)2 OctaneIssue (com.hp.octane.integrations.dto.securityscans.OctaneIssue)2 SonarIssue (com.hp.octane.integrations.services.vulnerabilities.sonar.dto.SonarIssue)1 Issues (com.hp.octane.integrations.services.vulnerabilities.ssc.dto.Issues)1