Search in sources :

Example 6 with ResourceLink

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

Example 7 with ResourceLink

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;
}
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 8 with ResourceLink

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;
}
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 9 with ResourceLink

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

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