Search in sources :

Example 1 with SSCRestClient

use of com.hp.octane.integrations.services.rest.SSCRestClient 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");
}
Also used : SSCRestClient(com.hp.octane.integrations.services.rest.SSCRestClient) SSCProjectConnector(com.hp.octane.integrations.services.vulnerabilities.ssc.SSCProjectConnector) SSCProjectConfiguration(com.hp.octane.integrations.dto.securityscans.SSCProjectConfiguration) Test(org.junit.Test)

Aggregations

SSCProjectConfiguration (com.hp.octane.integrations.dto.securityscans.SSCProjectConfiguration)1 SSCRestClient (com.hp.octane.integrations.services.rest.SSCRestClient)1 SSCProjectConnector (com.hp.octane.integrations.services.vulnerabilities.ssc.SSCProjectConnector)1 Test (org.junit.Test)1