use of com.synopsys.integration.blackduck.api.manual.component.ComponentVersionStatus in project hub-alert by blackducksoftware.
the class RuleViolationNotificationMessageExtractorTest method createComponentVersionStatus.
private ComponentVersionStatus createComponentVersionStatus() {
ComponentVersionStatus componentVersionStatus = new ComponentVersionStatus();
componentVersionStatus.setComponentName(COMPONENT.getValue());
componentVersionStatus.setComponent(COMPONENT_VERSION_URL);
componentVersionStatus.setComponentVersionName(COMPONENT_VERSION.getValue());
componentVersionStatus.setComponentVersion(COMPONENT_VERSION_URL);
componentVersionStatus.setBomComponent("http://bomComponentUrl");
return componentVersionStatus;
}
use of com.synopsys.integration.blackduck.api.manual.component.ComponentVersionStatus in project hub-alert by blackducksoftware.
the class AbstractRuleViolationNotificationMessageExtractor method createBomComponentDetails.
@Override
protected List<BomComponentDetails> createBomComponentDetails(T notificationContent, BlackDuckServicesFactory blackDuckServicesFactory) throws IntegrationException {
List<BomComponentDetails> bomComponentDetails = new LinkedList<>();
for (ComponentVersionStatus componentVersionStatus : notificationContent.getComponentVersionStatuses()) {
BomComponentDetails componentVersionDetails = createBomComponentDetails(blackDuckServicesFactory, notificationContent, componentVersionStatus);
bomComponentDetails.add(componentVersionDetails);
}
return bomComponentDetails;
}
use of com.synopsys.integration.blackduck.api.manual.component.ComponentVersionStatus in project hub-alert by blackducksoftware.
the class BlackDuckResponseTestUtility method createRuleViolationNotificationContent.
private RuleViolationNotificationContent createRuleViolationNotificationContent(String projectName, String projectVersionName) {
RuleViolationNotificationContent notificationContent = new RuleViolationNotificationContent();
notificationContent.setProjectName(projectName);
notificationContent.setProjectVersionName(projectVersionName);
notificationContent.setProjectVersion("https://a-project-version");
notificationContent.setComponentVersionsInViolation(1);
PolicyInfo policyInfo = new PolicyInfo();
policyInfo.setPolicy("https://a-policy");
policyInfo.setPolicyName("a policy");
policyInfo.setSeverity(PolicyRuleSeverityType.MAJOR.name());
notificationContent.setPolicyInfos(List.of(policyInfo));
ComponentVersionStatus componentVersionStatus = new ComponentVersionStatus();
componentVersionStatus.setBomComponent("https://bom-component");
componentVersionStatus.setComponentName("component name");
componentVersionStatus.setComponent("https://component");
componentVersionStatus.setComponentVersionName("component-version name");
componentVersionStatus.setComponentVersion("https://component-version");
componentVersionStatus.setPolicies(List.of(policyInfo.getPolicy()));
componentVersionStatus.setBomComponentVersionPolicyStatus(ProjectVersionComponentPolicyStatusType.IN_VIOLATION.name());
componentVersionStatus.setComponentIssueLink("https://component-issues");
notificationContent.setComponentVersionStatuses(List.of(componentVersionStatus));
return notificationContent;
}
use of com.synopsys.integration.blackduck.api.manual.component.ComponentVersionStatus in project hub-alert by blackducksoftware.
the class RuleViolationClearedNotificationMessageExtractorTest method createComponentVersionStatus.
private ComponentVersionStatus createComponentVersionStatus() {
ComponentVersionStatus componentVersionStatus = new ComponentVersionStatus();
componentVersionStatus.setComponentName(COMPONENT.getValue());
componentVersionStatus.setComponent(COMPONENT_VERSION_URL);
componentVersionStatus.setComponentVersionName(COMPONENT_VERSION.getValue());
componentVersionStatus.setComponentVersion(COMPONENT_VERSION_URL);
componentVersionStatus.setBomComponent("http://bomComponentUrl");
return componentVersionStatus;
}
use of com.synopsys.integration.blackduck.api.manual.component.ComponentVersionStatus in project hub-alert by blackducksoftware.
the class RuleViolationClearedUniquePolicyNotificationContentTest method getContentsTest.
@Test
public void getContentsTest() {
int componentVersionsCleared = 1;
ComponentVersionStatus componentVersionStatus = new ComponentVersionStatus();
PolicyInfo policyInfo = new PolicyInfo();
RuleViolationClearedUniquePolicyNotificationContent notificationContent = new RuleViolationClearedUniquePolicyNotificationContent(PROJECT_NAME, PROJECT_VERSION_NAME, PROJECT_VERSION_URL, componentVersionsCleared, List.of(componentVersionStatus), policyInfo);
assertEquals(PROJECT_NAME, notificationContent.getProjectName());
assertEquals(PROJECT_VERSION_NAME, notificationContent.getProjectVersionName());
assertEquals(PROJECT_VERSION_URL, notificationContent.getProjectVersionUrl());
assertEquals(componentVersionsCleared, notificationContent.getComponentVersionsCleared());
assertTrue(notificationContent.getComponentVersionStatuses().contains(componentVersionStatus));
assertEquals(policyInfo, notificationContent.getPolicyInfo());
}
Aggregations