use of com.synopsys.integration.alert.processor.api.MockProcessingAuditAccessor in project hub-alert by blackducksoftware.
the class ProviderMessageDistributorTest method distributeMissingDestinationKeyTest.
@Test
public void distributeMissingDestinationKeyTest() {
MockProcessingAuditAccessor processingAuditAccessor = new MockProcessingAuditAccessor();
EventManager eventManager = Mockito.mock(EventManager.class);
ProcessedNotificationDetails processedNotificationDetails = new ProcessedNotificationDetails(uuid, "bad channel key", "JobName");
ProcessedProviderMessageHolder processedMessageHolder = createProcessedProviderMessageHolder(1, 0);
ProviderMessageDistributor providerMessageDistributor = new ProviderMessageDistributor(processingAuditAccessor, eventManager);
providerMessageDistributor.distribute(processedNotificationDetails, processedMessageHolder);
Mockito.verify(eventManager, Mockito.times(0)).sendEvent(Mockito.any());
}
use of com.synopsys.integration.alert.processor.api.MockProcessingAuditAccessor in project hub-alert by blackducksoftware.
the class ProviderMessageDistributorTest method distributeTest.
@Test
public void distributeTest() {
MockProcessingAuditAccessor processingAuditAccessor = new MockProcessingAuditAccessor();
EventManager eventManager = Mockito.mock(EventManager.class);
ProcessedNotificationDetails processedNotificationDetails = new ProcessedNotificationDetails(uuid, slackChannelKey.getUniversalKey(), "JobName");
ProcessedProviderMessageHolder processedMessageHolder = createProcessedProviderMessageHolder(2, 2);
ProviderMessageDistributor providerMessageDistributor = new ProviderMessageDistributor(processingAuditAccessor, eventManager);
providerMessageDistributor.distribute(processedNotificationDetails, processedMessageHolder);
Mockito.verify(eventManager, Mockito.times(4)).sendEvent(Mockito.any());
}
Aggregations