Search in sources :

Example 1 with LicenseLimitNotificationView

use of com.synopsys.integration.blackduck.api.manual.view.LicenseLimitNotificationView in project hub-alert by blackducksoftware.

the class LicenseLimitNotificationDetailExtractorTest method extractDetailedContentTest.

@Test
public void extractDetailedContentTest() {
    LicenseLimitNotificationDetailExtractor extractor = new LicenseLimitNotificationDetailExtractor();
    LicenseLimitNotificationView notificationView = new LicenseLimitNotificationView();
    LicenseLimitNotificationContent notificationContent = new LicenseLimitNotificationContent();
    notificationView.setContent(notificationContent);
    AlertNotificationModel notification = new AlertNotificationModel(0L, 0L, "BlackDuck", "Config 1", null, null, null, null, false);
    List<DetailedNotificationContent> detailedNotificationContents = extractor.extractDetailedContent(notification, notificationView);
    assertEquals(1, detailedNotificationContents.size());
    DetailedNotificationContent detailedNotificationContent = detailedNotificationContents.get(0);
    assertTrue(detailedNotificationContent.getProjectName().isEmpty(), "Expected no project name to be present");
    assertTrue(detailedNotificationContent.getPolicyName().isEmpty(), "Expected no policy name to be present");
    assertEquals(0, detailedNotificationContent.getVulnerabilitySeverities().size());
}
Also used : AlertNotificationModel(com.synopsys.integration.alert.common.rest.model.AlertNotificationModel) LicenseLimitNotificationContent(com.synopsys.integration.blackduck.api.manual.component.LicenseLimitNotificationContent) DetailedNotificationContent(com.synopsys.integration.alert.processor.api.detail.DetailedNotificationContent) LicenseLimitNotificationView(com.synopsys.integration.blackduck.api.manual.view.LicenseLimitNotificationView) Test(org.junit.jupiter.api.Test)

Aggregations

AlertNotificationModel (com.synopsys.integration.alert.common.rest.model.AlertNotificationModel)1 DetailedNotificationContent (com.synopsys.integration.alert.processor.api.detail.DetailedNotificationContent)1 LicenseLimitNotificationContent (com.synopsys.integration.blackduck.api.manual.component.LicenseLimitNotificationContent)1 LicenseLimitNotificationView (com.synopsys.integration.blackduck.api.manual.view.LicenseLimitNotificationView)1 Test (org.junit.jupiter.api.Test)1