use of com.synopsys.integration.blackduck.api.manual.component.ProjectVersionNotificationContent in project hub-alert by blackducksoftware.
the class DetailedNotificationContentTest method versionlessTest.
@Test
public void versionlessTest() {
String projectName = "project with version";
String projectVersionName = "version";
ProjectVersionNotificationContent projectVersionNotificationContent = new ProjectVersionNotificationContent();
DetailedNotificationContent detailedContent = DetailedNotificationContent.versionLess(ALERT_NOTIFICATION_MODEL, projectVersionNotificationContent, projectName);
assertContent(detailedContent, ALERT_NOTIFICATION_MODEL.getProviderConfigId(), projectVersionNotificationContent.getClass(), List.of());
assertEquals(projectName, detailedContent.getProjectName().orElse(null));
assertTrue(detailedContent.getPolicyName().isEmpty(), EXPECTED_NO_POLICY);
assertNull(detailedContent.getProjectVersionName().orElse(null));
}
use of com.synopsys.integration.blackduck.api.manual.component.ProjectVersionNotificationContent in project hub-alert by blackducksoftware.
the class NotificationDetailExtractionDelegatorTest method wrapNotificationTest.
@Test
public void wrapNotificationTest() {
ProjectVersionNotificationDetailExtractor projectVersionNDE = new ProjectVersionNotificationDetailExtractor();
NotificationDetailExtractionDelegator delegator = new NotificationDetailExtractionDelegator(RESPONSE_RESOLVER, List.of(projectVersionNDE));
List<DetailedNotificationContent> detailedContent = delegator.wrapNotification(ALERT_NOTIFICATION_MODEL);
assertEquals(1, detailedContent.size());
ProjectVersionNotificationContent content = PVN_VIEW.getContent();
DetailedNotificationContent detailedPVN = detailedContent.get(0);
assertEquals(content.getProjectName(), detailedPVN.getProjectName().orElse(null));
}
Aggregations