use of com.synopsys.integration.alert.common.persistence.model.job.FilteredDistributionJobResponseModel 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.common.persistence.model.job.FilteredDistributionJobResponseModel in project hub-alert by blackducksoftware.
the class JobNotificationFilterUtilsTest method doesProjectVersionNameMatchWithProjectTest.
@Test
public void doesProjectVersionNameMatchWithProjectTest() {
String validProject = "projectName";
List<String> projects = List.of("fake project", "project 2", "flippant", validProject);
FilteredDistributionJobResponseModel jobResponseModel = createFilteredDistributionJobResponseModel(List.of(), projects, List.of(), List.of(), true, "", "1.0.*");
boolean doesProjectApplyToJob = JobNotificationFilterUtils.doesProjectApplyToJob(jobResponseModel, "projectName", "1.0.0");
assertTrue(doesProjectApplyToJob);
}
use of com.synopsys.integration.alert.common.persistence.model.job.FilteredDistributionJobResponseModel in project hub-alert by blackducksoftware.
the class JobNotificationFilterUtilsTest method doesProjectVersionNameMatchWithInvalidProjectPatternMatchTest.
@Test
public void doesProjectVersionNameMatchWithInvalidProjectPatternMatchTest() {
List<String> projects = List.of("fake project", "project 2", "flippant");
FilteredDistributionJobResponseModel jobResponseModel = createFilteredDistributionJobResponseModel(List.of(), projects, List.of(), List.of(), true, "projectN.*", "1.0.*");
boolean doesProjectApplyToJob = JobNotificationFilterUtils.doesProjectApplyToJob(jobResponseModel, "wrong", "1.0.0");
assertFalse(doesProjectApplyToJob);
}
use of com.synopsys.integration.alert.common.persistence.model.job.FilteredDistributionJobResponseModel in project hub-alert by blackducksoftware.
the class JobNotificationFilterUtilsTest method doesProjectVersionNameMatchWithProjectPatternMatchTest.
@Test
public void doesProjectVersionNameMatchWithProjectPatternMatchTest() {
List<String> projects = List.of("fake project", "project 2", "flippant");
FilteredDistributionJobResponseModel jobResponseModel = createFilteredDistributionJobResponseModel(List.of(), projects, List.of(), List.of(), true, "projectN.*", "1.0.*");
boolean doesProjectApplyToJob = JobNotificationFilterUtils.doesProjectApplyToJob(jobResponseModel, "projectName", "1.0.0");
assertTrue(doesProjectApplyToJob);
}
Aggregations