@Test public void filterShouldAddUsernameWhenNoVirtualHostingAndMailboxSessionContainsUsername() throws UsersRepositoryException { usersRepository.setEnableVirtualHosting(false); MailboxSession mailboxSession = MailboxSessionUtil.create(USERNAME); testee.provisionUser(mailboxSession).block(); assertThat(usersRepository.list()).toIterable() .contains(USERNAME); }
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);  }