@Test void fixMailboxInconsistenciesShouldNotAlterStateWhenLoop() { mailboxDAO.save(MAILBOX).block(); Mailbox mailbox2 = new Mailbox(NEW_MAILBOX_PATH, UID_VALIDITY_2, CASSANDRA_ID_2); mailboxDAO.save(mailbox2).block(); mailboxPathV2DAO.save(MAILBOX_PATH, CASSANDRA_ID_2).block(); mailboxPathV2DAO.save(NEW_MAILBOX_PATH, CASSANDRA_ID_1).block(); testee.fixMailboxInconsistencies(new Context()).block(); SoftAssertions.assertSoftly(softly -> { softly.assertThat(mailboxDAO.retrieveAllMailboxes().collectList().block()) .containsExactlyInAnyOrder(MAILBOX, mailbox2); softly.assertThat(mailboxPathV2DAO.listAll().collectList().block()) .containsExactlyInAnyOrder( new CassandraIdAndPath(CASSANDRA_ID_1, NEW_MAILBOX_PATH), new CassandraIdAndPath(CASSANDRA_ID_2, MAILBOX_PATH)); }); }
public Mono<Result> fixMailboxInconsistencies(Context context) { assertValidVersion(); return Flux.concat( processMailboxDaoInconsistencies(context), processMailboxPathDaoInconsistencies(context)) .reduce(Result.COMPLETED, Task::combine); }
SolveMailboxInconsistenciesService { public Mono<Result> fixMailboxInconsistencies(Context context) { assertValidVersion(); return Flux.concat( processMailboxDaoInconsistencies(context), processMailboxPathDaoInconsistencies(context)) .reduce(Result.COMPLETED, Task::combine); } }
SolveMailboxInconsistenciesService { public Mono<Result> fixMailboxInconsistencies(Context context) { assertValidVersion(); return Flux.concat( processMailboxDaoInconsistencies(context), processMailboxPathDaoInconsistencies(context)) .reduce(Result.COMPLETED, Task::combine); } @Inject  SolveMailboxInconsistenciesService(CassandraMailboxDAO mailboxDAO, CassandraMailboxPathV2DAO mailboxPathV2DAO, CassandraSchemaVersionManager versionManager); }
SolveMailboxInconsistenciesService { public Mono<Result> fixMailboxInconsistencies(Context context) { assertValidVersion(); return Flux.concat( processMailboxDaoInconsistencies(context), processMailboxPathDaoInconsistencies(context)) .reduce(Result.COMPLETED, Task::combine); } @Inject  SolveMailboxInconsistenciesService(CassandraMailboxDAO mailboxDAO, CassandraMailboxPathV2DAO mailboxPathV2DAO, CassandraSchemaVersionManager versionManager); Mono<Result> fixMailboxInconsistencies(Context context); }
SolveMailboxInconsistenciesService { public Mono<Result> fixMailboxInconsistencies(Context context) { assertValidVersion(); return Flux.concat( processMailboxDaoInconsistencies(context), processMailboxPathDaoInconsistencies(context)) .reduce(Result.COMPLETED, Task::combine); } @Inject  SolveMailboxInconsistenciesService(CassandraMailboxDAO mailboxDAO, CassandraMailboxPathV2DAO mailboxPathV2DAO, CassandraSchemaVersionManager versionManager); Mono<Result> fixMailboxInconsistencies(Context context); static final Logger LOGGER; }