@Before public void setUp() { dispatcher = new NewIssuesNotificationDispatcher(notifications); }
@Test public void shouldNotDispatchIfNotNewViolationsNotification() { Notification notification = new Notification("other-notif"); dispatcher.performDispatch(notification, context); verify(context, never()).addUser(any(String.class), any(NotificationChannel.class)); }
ChangesOnMyIssueNotificationDispatcher.newMetadata(), NewIssuesNotificationDispatcher.class, NewIssuesNotificationDispatcher.newMetadata(), MyNewIssuesNotificationDispatcher.class, MyNewIssuesNotificationDispatcher.newMetadata(),
ChangesOnMyIssueNotificationDispatcher.newMetadata(), NewIssuesNotificationDispatcher.class, NewIssuesNotificationDispatcher.newMetadata(), MyNewIssuesNotificationDispatcher.class, MyNewIssuesNotificationDispatcher.newMetadata(),
ChangesOnMyIssueNotificationDispatcher.newMetadata(), NewIssuesNotificationDispatcher.class, NewIssuesNotificationDispatcher.newMetadata(), MyNewIssuesNotificationDispatcher.class, MyNewIssuesNotificationDispatcher.newMetadata(),
@Test public void shouldDispatchToUsersWhoHaveSubscribedAndFlaggedProjectAsFavourite() { Multimap<String, NotificationChannel> recipients = HashMultimap.create(); recipients.put("user1", emailChannel); recipients.put("user2", twitterChannel); when(notifications.findSubscribedRecipientsForDispatcher(dispatcher, "struts", new NotificationManager.SubscriberPermissionsOnProject(UserRole.USER))).thenReturn(recipients); Notification notification = new Notification(NewIssuesNotification.TYPE) .setFieldValue("projectKey", "struts"); dispatcher.performDispatch(notification, context); verify(context).addUser("user1", emailChannel); verify(context).addUser("user2", twitterChannel); verifyNoMoreInteractions(context); } }
ChangesOnMyIssueNotificationDispatcher.newMetadata(), NewIssuesNotificationDispatcher.class, NewIssuesNotificationDispatcher.newMetadata(), MyNewIssuesNotificationDispatcher.class, MyNewIssuesNotificationDispatcher.newMetadata(),