use of com.blackducksoftware.integration.hub.alert.channel.slack.SlackManager in project hub-alert by blackducksoftware.
the class SlackConfigActionsTest method createMockedConfigActionsUsingObjectTransformer.
@Override
public SlackDistributionConfigActions createMockedConfigActionsUsingObjectTransformer(final ObjectTransformer objectTransformer) {
final SlackManager slackManager = Mockito.mock(SlackManager.class);
final SlackDistributionRepositoryWrapper mockedSlackRepository = Mockito.mock(SlackDistributionRepositoryWrapper.class);
final CommonDistributionRepositoryWrapper commonRepository = Mockito.mock(CommonDistributionRepositoryWrapper.class);
final ConfiguredProjectsRepositoryWrapper projectsRepository = Mockito.mock(ConfiguredProjectsRepositoryWrapper.class);
final DistributionProjectRepositoryWrapper distributionProjectRepository = Mockito.mock(DistributionProjectRepositoryWrapper.class);
final ConfiguredProjectsActions<SlackDistributionRestModel> projectsAction = new ConfiguredProjectsActions<>(projectsRepository, distributionProjectRepository);
final NotificationTypeRepositoryWrapper notificationRepository = Mockito.mock(NotificationTypeRepositoryWrapper.class);
final DistributionNotificationTypeRepositoryWrapper notificationDistributionRepository = Mockito.mock(DistributionNotificationTypeRepositoryWrapper.class);
final NotificationTypesActions<SlackDistributionRestModel> notificationAction = new NotificationTypesActions<>(notificationRepository, notificationDistributionRepository);
final SlackDistributionConfigActions configActions = new SlackDistributionConfigActions(commonRepository, mockedSlackRepository, projectsAction, notificationAction, objectTransformer, slackManager);
return configActions;
}
use of com.blackducksoftware.integration.hub.alert.channel.slack.SlackManager in project hub-alert by blackducksoftware.
the class SlackDistributionConfigActionsTest method testTestConfig.
@Test
public void testTestConfig() throws Exception {
final SlackManager slackManager = Mockito.mock(SlackManager.class);
final SlackDistributionConfigActions configActions = new SlackDistributionConfigActions(null, null, null, null, null, slackManager);
configActions.testConfig(null);
verify(slackManager, times(1)).sendTestMessage(Mockito.any());
Mockito.reset(slackManager);
configActions.testConfig(null);
verify(slackManager, times(1)).sendTestMessage(Mockito.any());
}
Aggregations