@Override
  public Set<EmailRecipient> findSubscribedEmailRecipients(String dispatcherKey, String projectKey,
    SubscriberPermissionsOnProject subscriberPermissionsOnProject) {
    verifyProjectKey(projectKey);

    try (DbSession dbSession = dbClient.openSession(false)) {
      Set<EmailSubscriberDto> emailSubscribers = dbClient.propertiesDao().findEmailSubscribersForNotification(
        dbSession, dispatcherKey, EmailNotificationChannel.class.getSimpleName(), projectKey);

      return keepAuthorizedEmailSubscribers(dbSession, projectKey, subscriberPermissionsOnProject, emailSubscribers);
    }
  }
@Test
  public void findSubscribedEmailRecipients_with_logins_fails_with_NPE_if_projectKey_is_null() {
    String dispatcherKey = randomAlphabetic(12);

    assertThatThrownBy(() -> underTest.findSubscribedEmailRecipients(dispatcherKey, null, ImmutableSet.of(), ALL_MUST_HAVE_ROLE_USER))
      .isInstanceOf(NullPointerException.class)
      .hasMessage("projectKey is mandatory");
  }