Search in sources :

Example 6 with RuleViolationUniquePolicyNotificationContent

use of com.synopsys.integration.alert.provider.blackduck.processor.model.RuleViolationUniquePolicyNotificationContent in project hub-alert by blackducksoftware.

the class NotificationContentProcessorTest method processNotificationContentDigestTest.

@Test
public void processNotificationContentDigestTest() {
    AlertNotificationModel notificationModel = createNotification(NotificationType.RULE_VIOLATION.name());
    RuleViolationUniquePolicyNotificationContent notificationContent = blackDuckResponseTestUtility.createRuleViolationUniquePolicyNotificationContent(projectName, projectVersionName);
    NotificationContentWrapper notificationContentWrapper1 = new NotificationContentWrapper(notificationModel, notificationContent, RuleViolationUniquePolicyNotificationContent.class);
    NotificationContentWrapper notificationContentWrapper2 = new NotificationContentWrapper(notificationModel, notificationContent, RuleViolationUniquePolicyNotificationContent.class);
    // When set to digest, the NotificationContentProcessor will combine duplicate duplicate messages created from the two NotificationContentWrappers to a single message
    ProcessedProviderMessageHolder processedProviderMessageHolder = notificationContentProcessor.processNotificationContent(ProcessingType.DIGEST, List.of(notificationContentWrapper1, notificationContentWrapper2));
    runProjectMessageAssertions(processedProviderMessageHolder, projectName, projectVersionName);
}
Also used : AlertNotificationModel(com.synopsys.integration.alert.common.rest.model.AlertNotificationModel) ProcessedProviderMessageHolder(com.synopsys.integration.alert.processor.api.extract.model.ProcessedProviderMessageHolder) RuleViolationUniquePolicyNotificationContent(com.synopsys.integration.alert.provider.blackduck.processor.model.RuleViolationUniquePolicyNotificationContent) NotificationContentWrapper(com.synopsys.integration.alert.processor.api.filter.NotificationContentWrapper) Test(org.junit.jupiter.api.Test)

Aggregations

RuleViolationUniquePolicyNotificationContent (com.synopsys.integration.alert.provider.blackduck.processor.model.RuleViolationUniquePolicyNotificationContent)6 Test (org.junit.jupiter.api.Test)5 AlertNotificationModel (com.synopsys.integration.alert.common.rest.model.AlertNotificationModel)3 ProcessedProviderMessageHolder (com.synopsys.integration.alert.processor.api.extract.model.ProcessedProviderMessageHolder)3 NotificationContentWrapper (com.synopsys.integration.alert.processor.api.filter.NotificationContentWrapper)3 BomComponentDetails (com.synopsys.integration.alert.processor.api.extract.model.project.BomComponentDetails)2 BlackDuckApiClient (com.synopsys.integration.blackduck.service.BlackDuckApiClient)2 BlackDuckServicesFactory (com.synopsys.integration.blackduck.service.BlackDuckServicesFactory)2 HttpUrl (com.synopsys.integration.rest.HttpUrl)2 ProcessedProviderMessage (com.synopsys.integration.alert.processor.api.extract.model.ProcessedProviderMessage)1 SimpleMessage (com.synopsys.integration.alert.processor.api.extract.model.SimpleMessage)1 ComponentPolicy (com.synopsys.integration.alert.processor.api.extract.model.project.ComponentPolicy)1 ComponentUpgradeGuidance (com.synopsys.integration.alert.processor.api.extract.model.project.ComponentUpgradeGuidance)1 ProjectMessage (com.synopsys.integration.alert.processor.api.extract.model.project.ProjectMessage)1 ResourceMetadata (com.synopsys.integration.blackduck.api.core.ResourceMetadata)1 ComponentPolicyRulesView (com.synopsys.integration.blackduck.api.generated.view.ComponentPolicyRulesView)1 PolicyRuleView (com.synopsys.integration.blackduck.api.generated.view.PolicyRuleView)1 ProjectVersionComponentVersionView (com.synopsys.integration.blackduck.api.generated.view.ProjectVersionComponentVersionView)1 RuleViolationNotificationContent (com.synopsys.integration.blackduck.api.manual.component.RuleViolationNotificationContent)1 IntegrationRestException (com.synopsys.integration.rest.exception.IntegrationRestException)1