use of com.synopsys.integration.blackduck.api.core.ResourceLink 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.core.ResourceLink in project hub-alert by blackducksoftware.
the class RuleViolationClearedNotificationMessageExtractorTest method createProjectVersionComponentVersionView.
private ProjectVersionComponentVersionView createProjectVersionComponentVersionView() throws IntegrationException {
ProjectVersionComponentVersionView projectVersionComponentVersionView = new ProjectVersionComponentVersionView();
projectVersionComponentVersionView.setComponentName(COMPONENT.getValue());
projectVersionComponentVersionView.setComponentVersion(COMPONENT_VERSION_URL);
projectVersionComponentVersionView.setComponentVersionName(COMPONENT_VERSION.getValue());
projectVersionComponentVersionView.setPolicyStatus(ProjectVersionComponentPolicyStatusType.IN_VIOLATION);
projectVersionComponentVersionView.setUsages(List.of(UsageType.DYNAMICALLY_LINKED));
ProjectVersionComponentVersionLicensesView projectVersionComponentVersionLicensesView = new ProjectVersionComponentVersionLicensesView();
projectVersionComponentVersionLicensesView.setLicense("http://licenseLink");
projectVersionComponentVersionLicensesView.setLicenseDisplay(LICENSE_DISPLAY);
projectVersionComponentVersionView.setLicenses(List.of(projectVersionComponentVersionLicensesView));
ResourceLink resourceLink = new ResourceLink();
resourceLink.setHref(new HttpUrl("https://someHref"));
resourceLink.setRel("policy-rules");
ResourceMetadata meta = new ResourceMetadata();
meta.setHref(new HttpUrl("https://someUrl"));
meta.setLinks(List.of(resourceLink));
projectVersionComponentVersionView.setMeta(meta);
return projectVersionComponentVersionView;
}
use of com.synopsys.integration.blackduck.api.core.ResourceLink in project hub-alert by blackducksoftware.
the class PolicyOverrideNotificationMessageExtractorTest method createProjectVersionComponentVersionView.
private ProjectVersionComponentVersionView createProjectVersionComponentVersionView() throws IntegrationException {
ProjectVersionComponentVersionView projectVersionComponentVersionView = new ProjectVersionComponentVersionView();
projectVersionComponentVersionView.setComponentName(COMPONENT.getValue());
projectVersionComponentVersionView.setComponentVersion(COMPONENT_VERSION_URL);
projectVersionComponentVersionView.setComponentVersionName(COMPONENT_VERSION.getValue());
projectVersionComponentVersionView.setPolicyStatus(ProjectVersionComponentPolicyStatusType.IN_VIOLATION);
projectVersionComponentVersionView.setUsages(List.of(UsageType.DYNAMICALLY_LINKED));
ProjectVersionComponentVersionLicensesView projectVersionComponentVersionLicensesView = new ProjectVersionComponentVersionLicensesView();
projectVersionComponentVersionLicensesView.setLicense("http://licenseLink");
projectVersionComponentVersionLicensesView.setLicenseDisplay(LICENSE_DISPLAY);
projectVersionComponentVersionView.setLicenses(List.of(projectVersionComponentVersionLicensesView));
ResourceLink resourceLink = new ResourceLink();
resourceLink.setHref(new HttpUrl("https://someHref"));
resourceLink.setRel("policy-rules");
ResourceMetadata meta = new ResourceMetadata();
meta.setHref(new HttpUrl("https://someUrl"));
meta.setLinks(List.of(resourceLink));
projectVersionComponentVersionView.setMeta(meta);
return projectVersionComponentVersionView;
}
use of com.synopsys.integration.blackduck.api.core.ResourceLink 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