use of com.hp.octane.integrations.services.vulnerabilities.ssc.SSCProjectConnector in project octane-ci-java-sdk by MicroFocus.
the class SSCProjectConnectorPagingTest method pagingOfIssues.
@Test
public void pagingOfIssues() {
SSCProjectConfiguration configMock = createNiceMock(SSCProjectConfiguration.class);
expect(configMock.getSSCUrl()).andReturn("DummyURL").anyTimes();
replay(configMock);
SSCProjectConnector sscProjectConnector = new SSCProjectConnector(configMock, new MockSSCRestClient(Arrays.asList(DummyContents.issuesPart1, DummyContents.issuesPart2, DummyContents.issuesPart3)));
Issues issues = sscProjectConnector.readIssues(1);
Assert.assertEquals(3, issues.getCount());
Assert.assertEquals("Issue 1", issues.getData().get(0).issueName);
Assert.assertEquals("Issue 2", issues.getData().get(1).issueName);
Assert.assertEquals("Issue 3", issues.getData().get(2).issueName);
}
use of com.hp.octane.integrations.services.vulnerabilities.ssc.SSCProjectConnector in project octane-ci-java-sdk by MicroFocus.
the class VulnerabilitiesTests method wellFormedURLS.
@Test
public void wellFormedURLS() {
SSCProjectConfiguration sscFortifyConfigurations = dtoFactory.newDTO(SSCProjectConfiguration.class).setSSCUrl("server_url").setProjectName("project").setProjectVersion("version").setSSCBaseAuthToken("");
SSCRestClient sscClientMock = createNiceMock(SSCRestClient.class);
replay();
SSCProjectConnector sscProjectConnector = new SSCProjectConnector(sscFortifyConfigurations, sscClientMock);
String projectIdURL = sscProjectConnector.getProjectIdURL();
String newIssuesURL = sscProjectConnector.getIssuesURL(1);
String artifactsURL = sscProjectConnector.getArtifactsURL(100, 1000);
String urlForProjectVersion = sscProjectConnector.getURLForProjectVersion(500);
Assert.assertEquals(projectIdURL, "projects?q=name:project");
Assert.assertEquals(newIssuesURL, "projectVersions/1/issues?showhidden=false&showremoved=false&showsuppressed=false");
Assert.assertEquals(artifactsURL, "projectVersions/100/artifacts?limit=1000");
Assert.assertEquals(urlForProjectVersion, "projects/500/versions?q=name:version");
}
Aggregations