use of com.synopsys.integration.alert.common.persistence.accessor.ProviderTaskPropertiesAccessor in project hub-alert by blackducksoftware.
the class BlackDuckAccumulatorTest method runNotificationRetrieverThrowsException.
@Test
public void runNotificationRetrieverThrowsException() throws IntegrationException {
ProviderTaskPropertiesAccessor taskPropertiesAccessor = Mockito.mock(ProviderTaskPropertiesAccessor.class);
BlackDuckProperties blackDuckProperties = createBlackDuckProperties();
BlackDuckSystemValidator validator = createBlackDuckValidator(blackDuckProperties, true);
BlackDuckNotificationRetriever notificationRetriever = Mockito.mock(BlackDuckNotificationRetriever.class);
Mockito.when(notificationRetriever.retrievePageOfFilteredNotifications(Mockito.any(), Mockito.anyList())).thenThrow(new IntegrationException("Test Exception"));
BlackDuckNotificationRetrieverFactory notificationRetrieverFactory = createBlackDuckNotificationRetrieverFactory(blackDuckProperties, notificationRetriever);
NotificationAccessor notificationAccessor = Mockito.mock(NotificationAccessor.class);
BlackDuckAccumulator accumulator = new BlackDuckAccumulator(BLACK_DUCK_PROVIDER_KEY, null, notificationAccessor, taskPropertiesAccessor, blackDuckProperties, validator, null, notificationRetrieverFactory);
accumulator.run();
Mockito.verify(notificationAccessor, Mockito.times(0)).saveAllNotifications(Mockito.anyList());
}
Aggregations