Search in sources :

Example 1 with ResourceLink

use of com.synopsys.integration.blackduck.api.core.ResourceLink in project hub-alert by blackducksoftware.

the class RuleViolationNotificationMessageExtractorTest 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;
}
Also used : ProjectVersionComponentVersionLicensesView(com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView) ResourceLink(com.synopsys.integration.blackduck.api.core.ResourceLink) ResourceMetadata(com.synopsys.integration.blackduck.api.core.ResourceMetadata) HttpUrl(com.synopsys.integration.rest.HttpUrl) ProjectVersionComponentVersionView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView)

Example 2 with ResourceLink

use of com.synopsys.integration.blackduck.api.core.ResourceLink in project hub-alert by blackducksoftware.

the class VulnerabilityNotificationMessageExtractorTest method createProjectVersionComponentVersionView.

private ProjectVersionComponentVersionView createProjectVersionComponentVersionView(boolean withOrigin) 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://policyRulesLink"));
    resourceLink.setRel("policy-rules");
    ResourceMetadata meta = new ResourceMetadata();
    meta.setHref(new HttpUrl("https://bomComponentHref"));
    meta.setLinks(List.of(resourceLink));
    projectVersionComponentVersionView.setMeta(meta);
    ResourceLink resourceLinkUpgradeGuidance = new ResourceLink();
    resourceLinkUpgradeGuidance.setHref(new HttpUrl(UPGRADE_GUIDANCE_URL));
    resourceLinkUpgradeGuidance.setRel("upgrade-guidance");
    ResourceMetadata metaUpgradeGuidance = new ResourceMetadata();
    metaUpgradeGuidance.setHref(new HttpUrl("https://upgradeGuidance"));
    metaUpgradeGuidance.setLinks(List.of(resourceLinkUpgradeGuidance));
    RiskProfileView riskProfileView = new RiskProfileView();
    RiskProfileCountsView riskProfileCountsView = new RiskProfileCountsView();
    riskProfileCountsView.setCount(BigDecimal.ONE);
    riskProfileCountsView.setCountType(RiskPriorityType.HIGH);
    riskProfileView.setCounts(List.of(riskProfileCountsView));
    projectVersionComponentVersionView.setSecurityRiskProfile(riskProfileView);
    if (withOrigin) {
        VersionBomOriginView versionBomOriginView = new VersionBomOriginView();
        versionBomOriginView.setMeta(metaUpgradeGuidance);
        projectVersionComponentVersionView.setOrigins(List.of(versionBomOriginView));
    } else {
        projectVersionComponentVersionView.setOrigins(List.of());
    }
    return projectVersionComponentVersionView;
}
Also used : RiskProfileCountsView(com.synopsys.integration.blackduck.api.generated.component.RiskProfileCountsView) VersionBomOriginView(com.synopsys.integration.blackduck.api.manual.temporary.component.VersionBomOriginView) RiskProfileView(com.synopsys.integration.blackduck.api.generated.view.RiskProfileView) ProjectVersionComponentVersionLicensesView(com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView) ResourceLink(com.synopsys.integration.blackduck.api.core.ResourceLink) ResourceMetadata(com.synopsys.integration.blackduck.api.core.ResourceMetadata) HttpUrl(com.synopsys.integration.rest.HttpUrl) ProjectVersionComponentVersionView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView)

Example 3 with ResourceLink

use of com.synopsys.integration.blackduck.api.core.ResourceLink in project hub-alert by blackducksoftware.

the class VulnerabilityNotificationMessageExtractorTest method createComponentVersionView.

private ComponentVersionView createComponentVersionView() throws IntegrationException {
    ComponentVersionView componentVersionView = new ComponentVersionView();
    ResourceLink resourceLinkUpgradeGuidance = new ResourceLink();
    resourceLinkUpgradeGuidance.setHref(new HttpUrl(UPGRADE_GUIDANCE_URL));
    resourceLinkUpgradeGuidance.setRel("upgrade-guidance");
    ResourceMetadata metaUpgradeGuidance = new ResourceMetadata();
    metaUpgradeGuidance.setHref(new HttpUrl("https://upgradeGuidance"));
    metaUpgradeGuidance.setLinks(List.of(resourceLinkUpgradeGuidance));
    componentVersionView.setMeta(metaUpgradeGuidance);
    return componentVersionView;
}
Also used : ResourceLink(com.synopsys.integration.blackduck.api.core.ResourceLink) ProjectVersionComponentVersionView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView) ComponentVersionView(com.synopsys.integration.blackduck.api.generated.view.ComponentVersionView) ResourceMetadata(com.synopsys.integration.blackduck.api.core.ResourceMetadata) HttpUrl(com.synopsys.integration.rest.HttpUrl)

Example 4 with ResourceLink

use of com.synopsys.integration.blackduck.api.core.ResourceLink in project hub-alert by blackducksoftware.

the class BomEditNotificationMessageExtractorTest 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;
}
Also used : ProjectVersionComponentVersionLicensesView(com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView) ResourceLink(com.synopsys.integration.blackduck.api.core.ResourceLink) ResourceMetadata(com.synopsys.integration.blackduck.api.core.ResourceMetadata) HttpUrl(com.synopsys.integration.rest.HttpUrl) ProjectVersionComponentVersionView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView)

Example 5 with ResourceLink

use of com.synopsys.integration.blackduck.api.core.ResourceLink 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;
}
Also used : ProjectVersionComponentVersionLicensesView(com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView) ResourceLink(com.synopsys.integration.blackduck.api.core.ResourceLink) ResourceMetadata(com.synopsys.integration.blackduck.api.core.ResourceMetadata) HttpUrl(com.synopsys.integration.rest.HttpUrl) ProjectVersionComponentVersionView(com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView)

Aggregations

ResourceLink (com.synopsys.integration.blackduck.api.core.ResourceLink)9 ResourceMetadata (com.synopsys.integration.blackduck.api.core.ResourceMetadata)9 HttpUrl (com.synopsys.integration.rest.HttpUrl)9 ProjectVersionComponentVersionView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView)7 ProjectVersionComponentVersionLicensesView (com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView)6 ProjectView (com.synopsys.integration.blackduck.api.generated.view.ProjectView)2 RiskProfileCountsView (com.synopsys.integration.blackduck.api.generated.component.RiskProfileCountsView)1 ComponentVersionView (com.synopsys.integration.blackduck.api.generated.view.ComponentVersionView)1 RiskProfileView (com.synopsys.integration.blackduck.api.generated.view.RiskProfileView)1 VersionBomOriginView (com.synopsys.integration.blackduck.api.manual.temporary.component.VersionBomOriginView)1