Search in sources :

Example 1 with EmailGroupManager

use of com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupManager in project hub-alert by blackducksoftware.

the class EmailConfigActionsTest method createMockedConfigActionsUsingObjectTransformer.

@Override
public EmailGroupDistributionConfigActions createMockedConfigActionsUsingObjectTransformer(final ObjectTransformer objectTransformer) {
    final EmailGroupManager emailManager = Mockito.mock(EmailGroupManager.class);
    final EmailGroupDistributionRepositoryWrapper mockedEmailRepository = Mockito.mock(EmailGroupDistributionRepositoryWrapper.class);
    final CommonDistributionRepositoryWrapper commonRepository = Mockito.mock(CommonDistributionRepositoryWrapper.class);
    final ConfiguredProjectsRepositoryWrapper projectsRepository = Mockito.mock(ConfiguredProjectsRepositoryWrapper.class);
    final DistributionProjectRepositoryWrapper distributionProjectRepository = Mockito.mock(DistributionProjectRepositoryWrapper.class);
    final ConfiguredProjectsActions<EmailGroupDistributionRestModel> projectsAction = new ConfiguredProjectsActions<>(projectsRepository, distributionProjectRepository);
    final NotificationTypeRepositoryWrapper notificationRepository = Mockito.mock(NotificationTypeRepositoryWrapper.class);
    final DistributionNotificationTypeRepositoryWrapper notificationDistributionRepository = Mockito.mock(DistributionNotificationTypeRepositoryWrapper.class);
    final NotificationTypesActions<EmailGroupDistributionRestModel> notificationAction = new NotificationTypesActions<>(notificationRepository, notificationDistributionRepository);
    final EmailGroupDistributionConfigActions emailGroupDistributionConfigActions = new EmailGroupDistributionConfigActions(commonRepository, mockedEmailRepository, projectsAction, notificationAction, objectTransformer, emailManager);
    return emailGroupDistributionConfigActions;
}
Also used : NotificationTypeRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.entity.repository.NotificationTypeRepositoryWrapper) DistributionNotificationTypeRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper) EmailGroupDistributionRepositoryWrapper(com.blackducksoftware.integration.hub.alert.channel.email.repository.distribution.EmailGroupDistributionRepositoryWrapper) 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) EmailGroupManager(com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupManager) CommonDistributionRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.entity.repository.CommonDistributionRepositoryWrapper) DistributionProjectRepositoryWrapper(com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionProjectRepositoryWrapper)

Example 2 with EmailGroupManager

use of com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupManager in project hub-alert by blackducksoftware.

the class EmailGroupDistributionConfigActionsTest method testTestConfig.

@Test
public void testTestConfig() throws Exception {
    final EmailGroupManager emailManager = Mockito.mock(EmailGroupManager.class);
    final EmailGroupDistributionConfigActions configActions = new EmailGroupDistributionConfigActions(null, null, null, null, null, emailManager);
    configActions.testConfig(null);
    verify(emailManager, times(1)).sendTestMessage(Mockito.any());
    Mockito.reset(emailManager);
    configActions.testConfig(null);
    verify(emailManager, times(1)).sendTestMessage(Mockito.any());
}
Also used : EmailGroupManager(com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupManager) Test(org.junit.Test)

Aggregations

EmailGroupManager (com.blackducksoftware.integration.hub.alert.channel.email.EmailGroupManager)2 EmailGroupDistributionRepositoryWrapper (com.blackducksoftware.integration.hub.alert.channel.email.repository.distribution.EmailGroupDistributionRepositoryWrapper)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