Search in sources :

Example 21 with ResourceMetadata

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

the class NotificationGeneratorUtils method createVulnerabilityList.

public static List<VulnerabilityView> createVulnerabilityList() throws IntegrationException {
    VulnerabilityView vuln_1 = new VulnerabilityView();
    vuln_1.setName("1");
    vuln_1.setSeverity(VulnerabilitySeverityType.LOW);
    vuln_1.setMeta(new ResourceMetadata());
    vuln_1.getMeta().setHref(new HttpUrl("href_1"));
    VulnerabilityView vuln_2 = new VulnerabilityView();
    vuln_2.setName("2");
    vuln_2.setSeverity(VulnerabilitySeverityType.LOW);
    vuln_2.setMeta(new ResourceMetadata());
    vuln_2.getMeta().setHref(new HttpUrl("href_2"));
    VulnerabilityView vuln_3 = new VulnerabilityView();
    vuln_3.setName("3");
    vuln_3.setSeverity(VulnerabilitySeverityType.LOW);
    vuln_3.setMeta(new ResourceMetadata());
    vuln_3.getMeta().setHref(new HttpUrl("href_3"));
    VulnerabilityView vuln_4 = new VulnerabilityView();
    vuln_4.setName("4");
    vuln_4.setSeverity(VulnerabilitySeverityType.MEDIUM);
    vuln_4.setMeta(new ResourceMetadata());
    vuln_4.getMeta().setHref(new HttpUrl("href_4"));
    VulnerabilityView vuln_5 = new VulnerabilityView();
    vuln_5.setName("5");
    vuln_5.setSeverity(VulnerabilitySeverityType.HIGH);
    vuln_5.setMeta(new ResourceMetadata());
    vuln_5.getMeta().setHref(new HttpUrl("href_5"));
    VulnerabilityView vuln_6 = new VulnerabilityView();
    vuln_6.setName("6");
    vuln_6.setSeverity(VulnerabilitySeverityType.HIGH);
    vuln_6.setMeta(new ResourceMetadata());
    vuln_6.getMeta().setHref(new HttpUrl("href_6"));
    VulnerabilityView vuln_7 = new VulnerabilityView();
    vuln_7.setName("7");
    vuln_7.setSeverity(VulnerabilitySeverityType.HIGH);
    vuln_7.setMeta(new ResourceMetadata());
    vuln_7.getMeta().setHref(new HttpUrl("href_7"));
    VulnerabilityView vuln_8 = new VulnerabilityView();
    vuln_8.setName("8");
    vuln_8.setSeverity(VulnerabilitySeverityType.HIGH);
    vuln_8.setMeta(new ResourceMetadata());
    vuln_8.getMeta().setHref(new HttpUrl("href_8"));
    VulnerabilityView vuln_9 = new VulnerabilityView();
    vuln_9.setName("9");
    vuln_9.setSeverity(VulnerabilitySeverityType.HIGH);
    vuln_9.setMeta(new ResourceMetadata());
    vuln_9.getMeta().setHref(new HttpUrl("href_9"));
    VulnerabilityView vuln_10 = new VulnerabilityView();
    vuln_10.setName("10");
    vuln_10.setSeverity(VulnerabilitySeverityType.HIGH);
    vuln_10.setMeta(new ResourceMetadata());
    vuln_10.getMeta().setHref(new HttpUrl("href_10"));
    VulnerabilityView vuln_11 = new VulnerabilityView();
    vuln_11.setName("11");
    vuln_11.setSeverity(VulnerabilitySeverityType.HIGH);
    vuln_11.setMeta(new ResourceMetadata());
    vuln_11.getMeta().setHref(new HttpUrl("href_11"));
    return Arrays.asList(vuln_1, vuln_2, vuln_3, vuln_4, vuln_5, vuln_6, vuln_7, vuln_8, vuln_9, vuln_10, vuln_11);
}
Also used : VulnerabilityView(com.synopsys.integration.blackduck.api.generated.view.VulnerabilityView) ResourceMetadata(com.synopsys.integration.blackduck.api.core.ResourceMetadata) HttpUrl(com.synopsys.integration.rest.HttpUrl)

Aggregations

ResourceMetadata (com.synopsys.integration.blackduck.api.core.ResourceMetadata)21 HttpUrl (com.synopsys.integration.rest.HttpUrl)21 ProjectVersionComponentVersionView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView)12 ResourceLink (com.synopsys.integration.blackduck.api.core.ResourceLink)9 ProjectVersionComponentVersionLicensesView (com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionLicensesView)7 BlackDuckApiClient (com.synopsys.integration.blackduck.service.BlackDuckApiClient)7 Test (org.junit.jupiter.api.Test)7 ComponentPolicy (com.synopsys.integration.alert.processor.api.extract.model.project.ComponentPolicy)6 ComponentPolicyRulesView (com.synopsys.integration.blackduck.api.generated.view.ComponentPolicyRulesView)6 PolicyRuleView (com.synopsys.integration.blackduck.api.generated.view.PolicyRuleView)6 BomComponentDetails (com.synopsys.integration.alert.processor.api.extract.model.project.BomComponentDetails)4 ComponentUpgradeGuidance (com.synopsys.integration.alert.processor.api.extract.model.project.ComponentUpgradeGuidance)4 ProjectView (com.synopsys.integration.blackduck.api.generated.view.ProjectView)4 BlackDuckServicesFactory (com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)4 BlackDuckComponentPolicyDetailsCreator (com.synopsys.integration.alert.provider.blackduck.processor.message.service.policy.BlackDuckComponentPolicyDetailsCreator)3 PolicyRuleExpressionExpressionsView (com.synopsys.integration.blackduck.api.generated.component.PolicyRuleExpressionExpressionsView)2 PolicyRuleExpressionView (com.synopsys.integration.blackduck.api.generated.component.PolicyRuleExpressionView)2 RuleViolationClearedUniquePolicyNotificationContent (com.synopsys.integration.alert.provider.blackduck.processor.model.RuleViolationClearedUniquePolicyNotificationContent)1 RuleViolationUniquePolicyNotificationContent (com.synopsys.integration.alert.provider.blackduck.processor.model.RuleViolationUniquePolicyNotificationContent)1 ProjectVersionComponentVersionVulnerabilityRemediationCvss2View (com.synopsys.integration.blackduck.api.generated.component.ProjectVersionComponentVersionVulnerabilityRemediationCvss2View)1