use of com.synopsys.integration.blackduck.api.generated.view.ProjectView in project hub-alert by blackducksoftware.
the class ProviderDataAccessorTest method createProjectView2.
private ProjectView createProjectView2() throws IntegrationException {
String href2 = "https://localhost:8443";
ProjectView projectView2 = new ProjectView();
ResourceMetadata resourceMetadata2 = new ResourceMetadata();
resourceMetadata2.setHref(new HttpUrl(href2));
projectView2.setMeta(resourceMetadata2);
return projectView2;
}
use of com.synopsys.integration.blackduck.api.generated.view.ProjectView in project hub-alert by blackducksoftware.
the class ProviderDataAccessorTest method getProjectByHrefTest.
@Test
void getProjectByHrefTest() throws IntegrationException {
ProjectView projectView = createProjectView1();
Mockito.when(blackDuckApiClient.getResponse(Mockito.any(HttpUrl.class), Mockito.eq(ProjectView.class))).thenReturn(projectView);
BlackDuckProviderDataAccessor blackDuckProviderDataAccessor = new BlackDuckProviderDataAccessor(configurationModelConfigurationAccessor, blackDuckPropertiesFactory);
Optional<ProviderProject> projectByHref = blackDuckProviderDataAccessor.getProjectByHref(providerConfiguration.getConfigurationId(), HREF_1);
assertTrue(projectByHref.isPresent());
ProviderProject providerProject = projectByHref.get();
assertEquals(HREF_1, providerProject.getHref());
}
use of com.synopsys.integration.blackduck.api.generated.view.ProjectView in project hub-alert by blackducksoftware.
the class ProviderDataAccessorTest method createProjectViewWithVersionsLink.
private ProjectView createProjectViewWithVersionsLink() throws IntegrationException {
ProjectView projectView = new ProjectView();
ResourceMetadata resourceMetadata = new ResourceMetadata();
resourceMetadata.setHref(new HttpUrl(HREF_1));
ResourceLink versionLink = new ResourceLink();
versionLink.setRel(ProjectView.VERSIONS_LINK);
versionLink.setHref(new HttpUrl("https://versionsHref.com"));
resourceMetadata.setLinks(List.of(versionLink));
projectView.setMeta(resourceMetadata);
return projectView;
}
use of com.synopsys.integration.blackduck.api.generated.view.ProjectView in project hub-alert by blackducksoftware.
the class ProviderDataAccessorTest method createProjectView1.
private ProjectView createProjectView1() throws IntegrationException {
ProjectView projectView = new ProjectView();
ResourceMetadata resourceMetadata = new ResourceMetadata();
resourceMetadata.setHref(new HttpUrl(HREF_1));
projectView.setMeta(resourceMetadata);
return projectView;
}
use of com.synopsys.integration.blackduck.api.generated.view.ProjectView in project hub-alert by blackducksoftware.
the class BlackDuckProjectSyncTaskTest method createProjectView.
private ProjectView createProjectView(String name, String description, String href) throws IntegrationException {
HttpUrl projectUrl = new HttpUrl(href);
ResourceLink usersLink = new ResourceLink();
usersLink.setRel(ProjectView.USERS_LINK);
usersLink.setHref(projectUrl.appendRelativeUrl(ProjectView.USERS_LINK));
ResourceMetadata resourceMetadata = new ResourceMetadata();
resourceMetadata.setHref(new HttpUrl(href));
resourceMetadata.setLinks(List.of(usersLink));
ProjectView projectView = new ProjectView();
projectView.setName(name);
projectView.setDescription(description);
projectView.setMeta(resourceMetadata);
return projectView;
}
Aggregations