use of com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView in project hub-alert by blackducksoftware.
the class BlackDuckMessageAttributesUtilsTest method testGetLicenseLinkableItems.
@Test
public void testGetLicenseLinkableItems() {
String licenseValue = "License Display 1";
ProjectVersionComponentVersionView projectVersionComponentView = new ProjectVersionComponentVersionView();
List<ProjectVersionComponentVersionLicensesView> projectVersionComponentLicensesViews = new ArrayList<>();
ProjectVersionComponentVersionLicensesView projectVersionComponentLicensesView1 = new ProjectVersionComponentVersionLicensesView();
projectVersionComponentLicensesView1.setLicenseDisplay(licenseValue);
projectVersionComponentLicensesViews.add(projectVersionComponentLicensesView1);
ProjectVersionComponentVersionLicensesView projectVersionComponentLicensesView2 = new ProjectVersionComponentVersionLicensesView();
projectVersionComponentLicensesView2.setLicenseDisplay("License Display 2");
projectVersionComponentLicensesViews.add(projectVersionComponentLicensesView2);
projectVersionComponentView.setLicenses(projectVersionComponentLicensesViews);
LinkableItem licenseLinkableItem = BlackDuckMessageAttributesUtils.extractLicense(projectVersionComponentView);
assertEquals(licenseValue, licenseLinkableItem.getValue());
}
use of com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView in project hub-alert by blackducksoftware.
the class BlackDuckResponseTestUtility method createProjectVersionComponentVersionView.
public ProjectVersionComponentVersionView createProjectVersionComponentVersionView() throws IntegrationException {
ProjectVersionComponentVersionView projectVersionComponentVersionView = new ProjectVersionComponentVersionView();
projectVersionComponentVersionView.setComponentName("component name");
projectVersionComponentVersionView.setComponentVersion("http://component-version-url");
projectVersionComponentVersionView.setComponentVersionName("component version name");
projectVersionComponentVersionView.setPolicyStatus(ProjectVersionComponentPolicyStatusType.IN_VIOLATION);
projectVersionComponentVersionView.setUsages(List.of(UsageType.DYNAMICALLY_LINKED));
ProjectVersionComponentVersionLicensesView projectVersionComponentVersionLicensesView = new ProjectVersionComponentVersionLicensesView();
projectVersionComponentVersionLicensesView.setLicense("http://license-link");
projectVersionComponentVersionLicensesView.setLicenseDisplay("license-display");
projectVersionComponentVersionView.setLicenses(List.of(projectVersionComponentVersionLicensesView));
ResourceLink resourceLink = new ResourceLink();
resourceLink.setHref(new HttpUrl("https://resource-url"));
resourceLink.setRel("policy-rules");
ResourceMetadata meta = new ResourceMetadata();
meta.setHref(new HttpUrl("https://meta-url"));
meta.setLinks(List.of(resourceLink));
projectVersionComponentVersionView.setMeta(meta);
return projectVersionComponentVersionView;
}
use of com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView 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.generated.component.ProjectVersionComponentVersionLicensesView 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;
}
Aggregations