use of com.hp.octane.integrations.services.vulnerabilities.ssc.SSCHandler in project octane-ci-java-sdk by MicroFocus.
the class VulnerabilitiesTests method extendedData.
@Test
public void extendedData() {
Issues.Issue issue = new Issues.Issue();
issue.issueName = "name";
issue.likelihood = "likelihood";
issue.impact = "impact";
issue.kingdom = "kingdom";
issue.confidance = "confidence";
issue.removedDate = "removedDate";
Issues sscIssues = new Issues();
sscIssues.setData(Arrays.asList(issue));
SSCHandler sscHandler = new SSCHandler();
List<OctaneIssue> octaneIssues = createOctaneIssues(sscIssues.getData(), "Tag", new HashMap<>());
Assert.assertEquals(octaneIssues.get(0).getExtendedData().get("issueName"), "name");
Assert.assertEquals(octaneIssues.get(0).getExtendedData().get("likelihood"), "likelihood");
Assert.assertEquals(octaneIssues.get(0).getExtendedData().get("kingdom"), "kingdom");
Assert.assertEquals(octaneIssues.get(0).getExtendedData().get("impact"), "impact");
Assert.assertEquals(octaneIssues.get(0).getExtendedData().get("confidence"), "confidence");
Assert.assertEquals(octaneIssues.get(0).getExtendedData().get("removedDate"), "removedDate");
}
use of com.hp.octane.integrations.services.vulnerabilities.ssc.SSCHandler in project octane-ci-java-sdk by MicroFocus.
the class VulnerabilitiesTests method analysisSSCToOctaneWellTransformed.
@Test
public void analysisSSCToOctaneWellTransformed() {
Issues sscIssues = new Issues();
Issues.Issue issue1 = new Issues.Issue();
issue1.reviewed = true;
Issues.Issue issue2 = new Issues.Issue();
issue2.audited = true;
Issues.Issue issue3 = new Issues.Issue();
issue3.issueStatus = "reviewed";
Issues.Issue issue4 = new Issues.Issue();
sscIssues.setData(Arrays.asList(issue1, issue2, issue3, issue4));
SSCHandler sscHandler = new SSCHandler();
List<OctaneIssue> octaneIssues = createOctaneIssues(sscIssues.getData(), "Tag", new HashMap<>());
for (int i = 0; i < 4; i++) {
if (i != 3) {
Assert.assertEquals("list_node.issue_analysis_node.reviewed", octaneIssues.get(i).getAnalysis().getId());
} else {
Assert.assertNull(octaneIssues.get(i).getAnalysis());
}
}
}
use of com.hp.octane.integrations.services.vulnerabilities.ssc.SSCHandler in project octane-ci-java-sdk by MicroFocus.
the class VulnerabilitiesTests method stateOctaneWellTransformed.
@Test
public void stateOctaneWellTransformed() {
Issues.Issue issue1 = new Issues.Issue();
issue1.scanStatus = "UPDATED";
Issues.Issue issue2 = new Issues.Issue();
issue2.scanStatus = "NEW";
Issues.Issue issue3 = new Issues.Issue();
issue3.scanStatus = "REINTRODUCED";
Issues.Issue issue4 = new Issues.Issue();
issue4.scanStatus = "REMOVED";
Issues.Issue issue5 = new Issues.Issue();
Issues sscIssues = new Issues();
sscIssues.setData(Arrays.asList(issue1, issue2, issue3, issue4, issue5));
SSCHandler sscHandler = new SSCHandler();
List<OctaneIssue> octaneIssues = createOctaneIssues(sscIssues.getData(), "Tag", new HashMap<>());
String[] expectedValues = new String[] { "list_node.issue_state_node.existing", "list_node.issue_state_node.new", "list_node.issue_state_node.reopen", "list_node.issue_state_node.closed" };
for (int i = 0; i < 5; i++) {
if (i != 4) {
Assert.assertEquals(expectedValues[i], octaneIssues.get(i).getState().getId());
} else {
Assert.assertNull(octaneIssues.get(i).getState());
}
}
}
Aggregations