@Test void migrationTaskShouldMoveDataToMostRecentDao() { daoV1.save(MAILBOX_PATH_1, MAILBOX_ID_1).block(); new MailboxPathV2Migration(daoV1, daoV2).apply(); SoftAssertions softly = new SoftAssertions(); softly.assertThat(daoV1.retrieveId(MAILBOX_PATH_1).blockOptional()).isEmpty(); softly.assertThat(daoV2.retrieveId(MAILBOX_PATH_1).blockOptional()) .contains(new CassandraIdAndPath(MAILBOX_ID_1, MAILBOX_PATH_1)); softly.assertAll(); }
@Override public void apply() { daoV1.readAll() .flatMap(this::migrate) .doOnError(t -> LOGGER.error("Error while performing migration", t)) .blockLast(); }
MailboxPathV2Migration implements Migration { @Override public void apply() { daoV1.readAll() .flatMap(this::migrate) .doOnError(t -> LOGGER.error("Error while performing migration", t)) .blockLast(); } }
MailboxPathV2Migration implements Migration { @Override public void apply() { daoV1.readAll() .flatMap(this::migrate) .doOnError(t -> LOGGER.error("Error while performing migration", t)) .blockLast(); } @Inject  MailboxPathV2Migration(CassandraMailboxPathDAOImpl daoV1, CassandraMailboxPathV2DAO daoV2); }
MailboxPathV2Migration implements Migration { @Override public void apply() { daoV1.readAll() .flatMap(this::migrate) .doOnError(t -> LOGGER.error("Error while performing migration", t)) .blockLast(); } @Inject  MailboxPathV2Migration(CassandraMailboxPathDAOImpl daoV1, CassandraMailboxPathV2DAO daoV2); @Override void apply(); @Override Task asTask(); }
MailboxPathV2Migration implements Migration { @Override public void apply() { daoV1.readAll() .flatMap(this::migrate) .doOnError(t -> LOGGER.error("Error while performing migration", t)) .blockLast(); } @Inject  MailboxPathV2Migration(CassandraMailboxPathDAOImpl daoV1, CassandraMailboxPathV2DAO daoV2); @Override void apply(); @Override Task asTask(); static final Logger LOGGER; static final TaskType TYPE; }