use of com.synopsys.integration.alert.processor.api.detail.DetailedNotificationContent in project hub-alert by blackducksoftware.
the class JobNotificationFilterUtilsTest method doesNotificationApplyToJobDefaultTest.
@Test
public void doesNotificationApplyToJobDefaultTest() {
NotificationContentComponent notificationContent = Mockito.mock(NotificationContentComponent.class);
AlertNotificationModel notificationModel = createAlertNotificationModel(NotificationType.LICENSE_LIMIT);
DetailedNotificationContent detailedNotificationContent = DetailedNotificationContent.projectless(notificationModel, notificationContent);
FilteredDistributionJobResponseModel jobResponseModel = createFilteredDistributionJobResponseModel(List.of(NotificationType.LICENSE_LIMIT.name()), List.of(), List.of(), List.of(), false, "", "");
assertTrue(JobNotificationFilterUtils.doesNotificationApplyToJob(jobResponseModel, detailedNotificationContent));
}
use of com.synopsys.integration.alert.processor.api.detail.DetailedNotificationContent in project hub-alert by blackducksoftware.
the class JobNotificationMapperTestIT method createNotificationWrappers.
private List<DetailedNotificationContent> createNotificationWrappers() {
AlertNotificationModel alertNotificationModel = createAlertNotificationModel(NotificationType.VULNERABILITY);
DetailedNotificationContent test_project = DetailedNotificationContent.vulnerability(alertNotificationModel, createVulnerabilityUniqueProjectNotificationContent(PROJECT_NAME_1), PROJECT_NAME_1, PROJECT_VERSION_NAME_1, List.of(VulnerabilitySeverityType.LOW.name()));
String projectName1 = "test_project1";
DetailedNotificationContent test_project2 = DetailedNotificationContent.vulnerability(alertNotificationModel, createVulnerabilityUniqueProjectNotificationContent(projectName1), projectName1, "version1", List.of(VulnerabilitySeverityType.HIGH.name()));
String projectName2 = "test_project2";
DetailedNotificationContent test_project3 = DetailedNotificationContent.vulnerability(alertNotificationModel, createVulnerabilityUniqueProjectNotificationContent(projectName2), projectName2, "version2", List.of(VulnerabilitySeverityType.LOW.name(), VulnerabilitySeverityType.HIGH.name()));
AlertNotificationModel alertPolicyNotificationModel = createAlertNotificationModel(NotificationType.POLICY_OVERRIDE);
DetailedNotificationContent test_project4 = DetailedNotificationContent.policy(alertPolicyNotificationModel, createVulnerabilityUniqueProjectNotificationContent(projectName2), projectName2, "1.0.0", POLICY_FILTER_NAME);
return List.of(test_project, test_project2, test_project3, test_project4);
}
Aggregations