@Test public void filterShouldDoNothingOnNullSession() throws UsersRepositoryException { testee.provisionUser(null).block(); assertThat(usersRepository.list()).toIterable() .isEmpty(); }
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);  }