@Test void retrieveIdShouldReturnEmptyWhenEmptyData() { assertThat(testee.retrieveId(USER_INBOX_MAILBOXPATH).blockOptional()) .isEmpty(); }
public Mono<CassandraIdAndPath> retrieveId(MailboxPath mailboxPath) { return cassandraAsyncExecutor.executeSingleRow( select.bind() .setString(NAMESPACE, mailboxPath.getNamespace()) .setString(USER, sanitizeUser(mailboxPath.getUser())) .setString(MAILBOX_NAME, mailboxPath.getName()) .setConsistencyLevel(consistencyLevel)) .map(this::fromRowToCassandraIdAndPath) .map(FunctionalUtils.toFunction(this::logGhostMailboxSuccess)) .switchIfEmpty(ReactorUtils.executeAndEmpty(() -> logGhostMailboxFailure(mailboxPath))); }
CassandraMailboxPathV2DAO { public Mono<CassandraIdAndPath> retrieveId(MailboxPath mailboxPath) { return cassandraAsyncExecutor.executeSingleRow( select.bind() .setString(NAMESPACE, mailboxPath.getNamespace()) .setString(USER, sanitizeUser(mailboxPath.getUser())) .setString(MAILBOX_NAME, mailboxPath.getName()) .setConsistencyLevel(consistencyLevel)) .map(this::fromRowToCassandraIdAndPath) .map(FunctionalUtils.toFunction(this::logGhostMailboxSuccess)) .switchIfEmpty(ReactorUtils.executeAndEmpty(() -> logGhostMailboxFailure(mailboxPath))); } }
CassandraMailboxPathV2DAO { public Mono<CassandraIdAndPath> retrieveId(MailboxPath mailboxPath) { return cassandraAsyncExecutor.executeSingleRow( select.bind() .setString(NAMESPACE, mailboxPath.getNamespace()) .setString(USER, sanitizeUser(mailboxPath.getUser())) .setString(MAILBOX_NAME, mailboxPath.getName()) .setConsistencyLevel(consistencyLevel)) .map(this::fromRowToCassandraIdAndPath) .map(FunctionalUtils.toFunction(this::logGhostMailboxSuccess)) .switchIfEmpty(ReactorUtils.executeAndEmpty(() -> logGhostMailboxFailure(mailboxPath))); } @Inject  CassandraMailboxPathV2DAO(Session session, CassandraUtils cassandraUtils,
                                     CassandraConsistenciesConfiguration consistenciesConfiguration); }
CassandraMailboxPathV2DAO { public Mono<CassandraIdAndPath> retrieveId(MailboxPath mailboxPath) { return cassandraAsyncExecutor.executeSingleRow( select.bind() .setString(NAMESPACE, mailboxPath.getNamespace()) .setString(USER, sanitizeUser(mailboxPath.getUser())) .setString(MAILBOX_NAME, mailboxPath.getName()) .setConsistencyLevel(consistencyLevel)) .map(this::fromRowToCassandraIdAndPath) .map(FunctionalUtils.toFunction(this::logGhostMailboxSuccess)) .switchIfEmpty(ReactorUtils.executeAndEmpty(() -> logGhostMailboxFailure(mailboxPath))); } @Inject  CassandraMailboxPathV2DAO(Session session, CassandraUtils cassandraUtils,
                                     CassandraConsistenciesConfiguration consistenciesConfiguration); Mono<CassandraIdAndPath> retrieveId(MailboxPath mailboxPath); Flux<CassandraIdAndPath> listUserMailboxes(String namespace, Username user); Flux<CassandraIdAndPath> listAll(); void logGhostMailboxSuccess(CassandraIdAndPath value); void logGhostMailboxFailure(MailboxPath mailboxPath); Mono<Boolean> save(MailboxPath mailboxPath, CassandraId mailboxId); Mono<Void> delete(MailboxPath mailboxPath); }
CassandraMailboxPathV2DAO { public Mono<CassandraIdAndPath> retrieveId(MailboxPath mailboxPath) { return cassandraAsyncExecutor.executeSingleRow( select.bind() .setString(NAMESPACE, mailboxPath.getNamespace()) .setString(USER, sanitizeUser(mailboxPath.getUser())) .setString(MAILBOX_NAME, mailboxPath.getName()) .setConsistencyLevel(consistencyLevel)) .map(this::fromRowToCassandraIdAndPath) .map(FunctionalUtils.toFunction(this::logGhostMailboxSuccess)) .switchIfEmpty(ReactorUtils.executeAndEmpty(() -> logGhostMailboxFailure(mailboxPath))); } @Inject  CassandraMailboxPathV2DAO(Session session, CassandraUtils cassandraUtils,
                                     CassandraConsistenciesConfiguration consistenciesConfiguration); Mono<CassandraIdAndPath> retrieveId(MailboxPath mailboxPath); Flux<CassandraIdAndPath> listUserMailboxes(String namespace, Username user); Flux<CassandraIdAndPath> listAll(); void logGhostMailboxSuccess(CassandraIdAndPath value); void logGhostMailboxFailure(MailboxPath mailboxPath); Mono<Boolean> save(MailboxPath mailboxPath, CassandraId mailboxId); Mono<Void> delete(MailboxPath mailboxPath);  }