use of com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper 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;
}
use of com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper in project hub-alert by blackducksoftware.
the class NotificationPostProcessorTestIT method isApplicableTest.
@Test
public void isApplicableTest() {
final DistributionNotificationTypeRepositoryWrapper distributionNotificationTypeRepository = Mockito.mock(DistributionNotificationTypeRepositoryWrapper.class);
final NotificationPostProcessor postProcessor = new NotificationPostProcessor(distributionProjectRepository, configuredProjectsRepository, distributionNotificationTypeRepository, notificationTypeRepository);
Mockito.when(distributionNotificationTypeRepository.findByCommonDistributionConfigId(Mockito.anyLong())).thenReturn(Collections.emptyList());
final ProjectData projectData = new ProjectData(null, null, null, null, null);
final CommonDistributionConfigEntity config = new CommonDistributionConfigEntity(13L, SupportedChannels.EMAIL_GROUP, "Config 1", DigestTypeEnum.DAILY, true);
config.setId(13L);
assertFalse(postProcessor.isApplicable(config, projectData));
}
use of com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper in project hub-alert by blackducksoftware.
the class HipChatConfigActionsTest method createMockedConfigActionsUsingObjectTransformer.
@Override
public HipChatDistributionConfigActions createMockedConfigActionsUsingObjectTransformer(final ObjectTransformer objectTransformer) {
final HipChatManager hipChatManager = Mockito.mock(HipChatManager.class);
final HipChatDistributionRepositoryWrapper mockedHipChatRepository = Mockito.mock(HipChatDistributionRepositoryWrapper.class);
final CommonDistributionRepositoryWrapper commonRepository = Mockito.mock(CommonDistributionRepositoryWrapper.class);
final ConfiguredProjectsRepositoryWrapper projectsRepository = Mockito.mock(ConfiguredProjectsRepositoryWrapper.class);
final DistributionProjectRepositoryWrapper distributionProjectRepository = Mockito.mock(DistributionProjectRepositoryWrapper.class);
final ConfiguredProjectsActions<HipChatDistributionRestModel> projectsAction = new ConfiguredProjectsActions<>(projectsRepository, distributionProjectRepository);
final NotificationTypeRepositoryWrapper notificationRepository = Mockito.mock(NotificationTypeRepositoryWrapper.class);
final DistributionNotificationTypeRepositoryWrapper notificationDistributionRepository = Mockito.mock(DistributionNotificationTypeRepositoryWrapper.class);
final NotificationTypesActions<HipChatDistributionRestModel> notificationAction = new NotificationTypesActions<>(notificationRepository, notificationDistributionRepository);
final HipChatDistributionConfigActions configActions = new HipChatDistributionConfigActions(commonRepository, mockedHipChatRepository, projectsAction, notificationAction, objectTransformer, hipChatManager);
return configActions;
}
use of com.blackducksoftware.integration.hub.alert.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper 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.datasource.relation.repository.DistributionNotificationTypeRepositoryWrapper in project hub-alert by blackducksoftware.
the class NotificationPostProcessorTestIT method doNotificationTypesMatchWithNoneConfiguredTest.
@Test
public void doNotificationTypesMatchWithNoneConfiguredTest() {
final DistributionNotificationTypeRepositoryWrapper distributionNotificationTypeRepository = Mockito.mock(DistributionNotificationTypeRepositoryWrapper.class);
final NotificationPostProcessor postProcessor = new NotificationPostProcessor(distributionProjectRepository, configuredProjectsRepository, distributionNotificationTypeRepository, notificationTypeRepository);
Mockito.when(distributionNotificationTypeRepository.findByCommonDistributionConfigId(Mockito.anyLong())).thenReturn(Collections.emptyList());
final ProjectData projectData = new ProjectData(null, null, null, null, null);
final CommonDistributionConfigEntity config = new CommonDistributionConfigEntity(13L, SupportedChannels.EMAIL_GROUP, "Config 1", DigestTypeEnum.DAILY, true);
config.setId(13L);
assertFalse(postProcessor.doNotificationTypesMatch(config, projectData));
}
Aggregations