@Test public void filterShouldFailOnInvalidVirtualHosting() { usersRepository.setEnableVirtualHosting(false); MailboxSession mailboxSession = MailboxSessionUtil.create(USERNAME_WITH_DOMAIN); assertThatThrownBy(() -> testee.provisionUser(mailboxSession).block()) .hasCauseInstanceOf(UsersRepositoryException.class); }
public Mono<Void> provisionUser(MailboxSession session) { if (session != null && !usersRepository.isReadOnly()) { return Mono.fromRunnable(() -> createAccountIfNeeded(session)); } return Mono.empty(); }
UserProvisioner { public Mono<Void> provisionUser(MailboxSession session) { if (session != null && !usersRepository.isReadOnly()) { return Mono.fromRunnable(() -> createAccountIfNeeded(session)); } return Mono.empty(); } }
UserProvisioner { public Mono<Void> provisionUser(MailboxSession session) { if (session != null && !usersRepository.isReadOnly()) { return Mono.fromRunnable(() -> createAccountIfNeeded(session)); } return Mono.empty(); } @Inject @VisibleForTesting  UserProvisioner(UsersRepository usersRepository, MetricFactory metricFactory); }
UserProvisioner { public Mono<Void> provisionUser(MailboxSession session) { if (session != null && !usersRepository.isReadOnly()) { return Mono.fromRunnable(() -> createAccountIfNeeded(session)); } return Mono.empty(); } @Inject @VisibleForTesting  UserProvisioner(UsersRepository usersRepository, MetricFactory metricFactory); Mono<Void> provisionUser(MailboxSession session); }
UserProvisioner { public Mono<Void> provisionUser(MailboxSession session) { if (session != null && !usersRepository.isReadOnly()) { return Mono.fromRunnable(() -> createAccountIfNeeded(session)); } return Mono.empty(); } @Inject @VisibleForTesting  UserProvisioner(UsersRepository usersRepository, MetricFactory metricFactory); Mono<Void> provisionUser(MailboxSession session);  }