Flux<String> getNotifiersBySubscriber(Subscriber subscriber, Reason reason) {
        var reasonType = reason.getSpec().getReasonType();
        return userNotificationPreferenceService.getByUser(subscriber.name())
            .map(UserNotificationPreference::getReasonTypeNotifier)
            .map(reasonTypeNotification -> reasonTypeNotification.getNotifiers(reasonType))
            .flatMapMany(Flux::fromIterable);
    }
@Test
    public void testGetNotifiersBySubscriber() {
        UserNotificationPreference preference = new UserNotificationPreference();
        when(userNotificationPreferenceService.getByUser(any()))
            .thenReturn(Mono.just(preference));

        var reason = new Reason();
        reason.setMetadata(new Metadata());
        reason.getMetadata().setName("reason-a");
        reason.setSpec(new Reason.Spec());
        reason.getSpec().setReasonType("new-reply-on-comment");
        var subscriber = new Subscriber(UserIdentity.anonymousWithEmail("A"), "fake-name");

        notificationCenter.getNotifiersBySubscriber(subscriber, reason)
            .collectList()
            .as(StepVerifier::create)
            .consumeNextWith(notifiers -> {
                assertThat(notifiers).hasSize(1);
                assertThat(notifiers.get(0)).isEqualTo("default-email-notifier");
            })
            .verifyComplete();

        verify(userNotificationPreferenceService).getByUser(eq(subscriber.name()));
    }