Search in sources :

Example 1 with ComponentVersionUpgradeGuidanceShortTermView

use of com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceShortTermView in project hub-alert by blackducksoftware.

the class BlackDuckMessageComponentVersionUpgradeGuidanceServiceTest method createUpgradeGuidance.

private ComponentVersionUpgradeGuidanceView createUpgradeGuidance(boolean includeShortTerm) {
    ComponentVersionUpgradeGuidanceView upgradeGuidanceView = new ComponentVersionUpgradeGuidanceView();
    if (includeShortTerm) {
        ComponentVersionUpgradeGuidanceShortTermView shortTermView = new ComponentVersionUpgradeGuidanceShortTermView();
        ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView shortTermRiskView = new ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView();
        shortTermRiskView.setCritical(BigDecimal.ZERO);
        shortTermRiskView.setHigh(BigDecimal.ZERO);
        shortTermRiskView.setMedium(BigDecimal.ZERO);
        shortTermRiskView.setLow(BigDecimal.ZERO);
        shortTermView.setVulnerabilityRisk(shortTermRiskView);
        upgradeGuidanceView.setShortTerm(shortTermView);
    }
    ComponentVersionUpgradeGuidanceLongTermView longTermView = new ComponentVersionUpgradeGuidanceLongTermView();
    ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView longTermRiskView = new ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView();
    longTermRiskView.setCritical(BigDecimal.TEN);
    longTermRiskView.setHigh(BigDecimal.valueOf(20L));
    longTermRiskView.setMedium(BigDecimal.valueOf(30L));
    longTermRiskView.setLow(BigDecimal.valueOf(40L));
    longTermView.setVulnerabilityRisk(longTermRiskView);
    upgradeGuidanceView.setLongTerm(longTermView);
    return upgradeGuidanceView;
}
Also used : ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView(com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView) ComponentVersionUpgradeGuidanceShortTermView(com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceShortTermView) ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView(com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView) ComponentVersionUpgradeGuidanceLongTermView(com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceLongTermView) ComponentVersionUpgradeGuidanceView(com.synopsys.integration.blackduck.api.generated.response.ComponentVersionUpgradeGuidanceView)

Example 2 with ComponentVersionUpgradeGuidanceShortTermView

use of com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceShortTermView in project hub-alert by blackducksoftware.

the class VulnerabilityNotificationMessageExtractorTest method createComponentVersionUpgradeGuidanceView.

private ComponentVersionUpgradeGuidanceView createComponentVersionUpgradeGuidanceView() {
    ComponentVersionUpgradeGuidanceView componentVersionUpgradeGuidanceView = new ComponentVersionUpgradeGuidanceView();
    ComponentVersionUpgradeGuidanceShortTermView shortTermView = new ComponentVersionUpgradeGuidanceShortTermView();
    shortTermView.setOrigin("http://upgradeGuidanceOriginUrlShortTerm");
    shortTermView.setOriginExternalId("upgradeGuidanceExternalIdShortTerm");
    shortTermView.setOriginExternalNamespace("upgradeGuidanceExternalNamespaceShortTerm");
    shortTermView.setOriginName("upgradeGuidanceOriginNameShortTerm");
    shortTermView.setVersion("http://upgradeGuidanceVersionShorTerm");
    shortTermView.setVersionName("upgradeGuidanceVersionNameShortTerm");
    ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView shortTermRiskView = new ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView();
    shortTermRiskView.setCritical(BigDecimal.ZERO);
    shortTermRiskView.setHigh(BigDecimal.ZERO);
    shortTermRiskView.setMedium(BigDecimal.ZERO);
    shortTermRiskView.setLow(BigDecimal.ZERO);
    shortTermView.setVulnerabilityRisk(shortTermRiskView);
    componentVersionUpgradeGuidanceView.setShortTerm(shortTermView);
    ComponentVersionUpgradeGuidanceLongTermView longTermView = new ComponentVersionUpgradeGuidanceLongTermView();
    longTermView.setOrigin("http://upgradeGuidanceOriginUrlLongTerm");
    longTermView.setOriginExternalId("upgradeGuidanceExternalIdLongTerm");
    longTermView.setOriginExternalNamespace("upgradeGuidanceExternalNamespaceLongTerm");
    longTermView.setOriginName("upgradeGuidanceOriginNameLongTerm");
    longTermView.setVersion("http://upgradeGuidanceVersionLongTerm");
    longTermView.setVersionName("upgradeGuidanceVersionNameLongTerm");
    ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView longTermRiskView = new ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView();
    longTermRiskView.setCritical(BigDecimal.ZERO);
    longTermRiskView.setHigh(BigDecimal.ZERO);
    longTermRiskView.setMedium(BigDecimal.ZERO);
    longTermRiskView.setLow(BigDecimal.ZERO);
    longTermView.setVulnerabilityRisk(longTermRiskView);
    componentVersionUpgradeGuidanceView.setLongTerm(longTermView);
    return componentVersionUpgradeGuidanceView;
}
Also used : ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView(com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView) ComponentVersionUpgradeGuidanceShortTermView(com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceShortTermView) ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView(com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView) ComponentVersionUpgradeGuidanceLongTermView(com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceLongTermView) ComponentVersionUpgradeGuidanceView(com.synopsys.integration.blackduck.api.generated.response.ComponentVersionUpgradeGuidanceView)

Aggregations

ComponentVersionUpgradeGuidanceLongTermView (com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceLongTermView)2 ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView (com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceLongTermVulnerabilityRiskView)2 ComponentVersionUpgradeGuidanceShortTermView (com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceShortTermView)2 ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView (com.synopsys.integration.blackduck.api.generated.component.ComponentVersionUpgradeGuidanceShortTermVulnerabilityRiskView)2 ComponentVersionUpgradeGuidanceView (com.synopsys.integration.blackduck.api.generated.response.ComponentVersionUpgradeGuidanceView)2