Search in sources :

Example 1 with SlackManager

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;
}
Also used : SlackManager(com.blackducksoftware.integration.hub.alert.channel.slack.SlackManager) NotificationTypeRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.entity.repository.NotificationTypeRepositoryWrapper) DistributionNotificationTypeRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper) NotificationTypesActions(com.blackducksoftware.integration.hub.alert.web.actions.NotificationTypesActions) ConfiguredProjectsRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.entity.repository.ConfiguredProjectsRepositoryWrapper) DistributionNotificationTypeRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper) ConfiguredProjectsActions(com.blackducksoftware.integration.hub.alert.web.actions.ConfiguredProjectsActions) CommonDistributionRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.entity.repository.CommonDistributionRepositoryWrapper) DistributionProjectRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionProjectRepositoryWrapper) SlackDistributionRepositoryWrapper(com.blackducksoftware.integration.hub.alert.channel.slack.repository.distribution.SlackDistributionRepositoryWrapper)

Example 2 with SlackManager

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());
}
Also used : SlackManager(com.blackducksoftware.integration.hub.alert.channel.slack.SlackManager) Test(org.junit.Test)

Aggregations

SlackManager (com.blackducksoftware.integration.hub.alert.channel.slack.SlackManager)2 SlackDistributionRepositoryWrapper (com.blackducksoftware.integration.hub.alert.channel.slack.repository.distribution.SlackDistributionRepositoryWrapper)1 CommonDistributionRepositoryWrapper (com.blackducksoftware.integration.hub.alert.datasource.entity.repository.CommonDistributionRepositoryWrapper)1 ConfiguredProjectsRepositoryWrapper (com.blackducksoftware.integration.hub.alert.datasource.entity.repository.ConfiguredProjectsRepositoryWrapper)1 NotificationTypeRepositoryWrapper (com.blackducksoftware.integration.hub.alert.datasource.entity.repository.NotificationTypeRepositoryWrapper)1 DistributionNotificationTypeRepositoryWrapper (com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper)1 DistributionProjectRepositoryWrapper (com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionProjectRepositoryWrapper)1 ConfiguredProjectsActions (com.blackducksoftware.integration.hub.alert.web.actions.ConfiguredProjectsActions)1 NotificationTypesActions (com.blackducksoftware.integration.hub.alert.web.actions.NotificationTypesActions)1 Test (org.junit.Test)1