Search in sources :

Example 6 with TestLogger

use of com.blackducksoftware.integration.test.TestLogger in project hub-alert by blackducksoftware.

the class NotificationItemProcessorTest method testProcessEvents.

@Test
public void testProcessEvents() throws HubIntegrationException {
    final GlobalProperties globalProperties = new TestGlobalProperties();
    final NotificationEvent event1 = new NotificationEvent("event 1", NotificationCategoryEnum.HIGH_VULNERABILITY, null);
    final NotificationEvent event2 = new NotificationEvent("event 2", NotificationCategoryEnum.LOW_VULNERABILITY, null);
    final List<NotificationEvent> eventList = Arrays.asList(event1, event2);
    final NotificationItemProcessor notificationItemProcessor = new NotificationItemProcessor(globalProperties, new TestLogger());
    final DBStoreEvent storeEvent = notificationItemProcessor.processEvents(eventList);
    assertEquals("DB_STORE_EVENT", storeEvent.getTopic());
    assertTrue(storeEvent.getNotificationList().size() == 2);
}
Also used : TestGlobalProperties(com.blackducksoftware.integration.hub.alert.TestGlobalProperties) GlobalProperties(com.blackducksoftware.integration.hub.alert.config.GlobalProperties) NotificationEvent(com.blackducksoftware.integration.hub.notification.NotificationEvent) DBStoreEvent(com.blackducksoftware.integration.hub.alert.event.DBStoreEvent) TestLogger(com.blackducksoftware.integration.test.TestLogger) TestGlobalProperties(com.blackducksoftware.integration.hub.alert.TestGlobalProperties) Test(org.junit.Test)

Aggregations

TestLogger (com.blackducksoftware.integration.test.TestLogger)6 Test (org.junit.Test)5 MapProcessorCache (com.blackducksoftware.integration.hub.notification.MapProcessorCache)4 ComponentVersionView (com.blackducksoftware.integration.hub.api.generated.view.ComponentVersionView)3 ProjectVersionModel (com.blackducksoftware.integration.hub.notification.ProjectVersionModel)3 Date (java.util.Date)3 TestGlobalProperties (com.blackducksoftware.integration.hub.alert.TestGlobalProperties)2 GlobalProperties (com.blackducksoftware.integration.hub.alert.config.GlobalProperties)2 PolicyRuleView (com.blackducksoftware.integration.hub.api.generated.view.PolicyRuleView)2 DBStoreEvent (com.blackducksoftware.integration.hub.alert.event.DBStoreEvent)1 VulnerabilitySourceQualifiedId (com.blackducksoftware.integration.hub.api.response.VulnerabilitySourceQualifiedId)1 NotificationEvent (com.blackducksoftware.integration.hub.notification.NotificationEvent)1 PolicyOverrideContentItem (com.blackducksoftware.integration.hub.notification.PolicyOverrideContentItem)1 PolicyViolationClearedContentItem (com.blackducksoftware.integration.hub.notification.PolicyViolationClearedContentItem)1 VulnerabilityContentItem (com.blackducksoftware.integration.hub.notification.VulnerabilityContentItem)1