@Test public void migrateMoveOrCopy_withUidArray() { OldPendingCommand command = queueMoveOrCopy(SOURCE_FOLDER, DEST_FOLDER, IS_COPY, UID_ARRAY); PendingMoveOrCopy pendingCommand = (PendingMoveOrCopy) MigrationTo60.migratePendingCommand(command); assertEquals(SOURCE_FOLDER, pendingCommand.srcFolder); assertEquals(DEST_FOLDER, pendingCommand.destFolder); assertEquals(IS_COPY, pendingCommand.isCopy); assertEquals(asList(UID_ARRAY), pendingCommand.uids); assertNull(pendingCommand.newUidMap); }
@VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG: { return migrateCommandSetFlag(oldPendingCommand); } case PENDING_COMMAND_MARK_ALL_AS_READ: { return migrateCommandMarkAllAsRead(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK: { return migrateCommandMoveOrCopyBulk(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK_NEW: { return migrateCommandMoveOrCopyBulkNew(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY: { return migrateCommandMoveOrCopy(oldPendingCommand); } case PENDING_COMMAND_EMPTY_TRASH: { return migrateCommandEmptyTrash(); } case PENDING_COMMAND_EXPUNGE: { return migrateCommandExpunge(oldPendingCommand); } default: { throw new IllegalArgumentException("Tried to migrate unknown pending command!"); } } }
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG: { return migrateCommandSetFlag(oldPendingCommand); } case PENDING_COMMAND_MARK_ALL_AS_READ: { return migrateCommandMarkAllAsRead(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK: { return migrateCommandMoveOrCopyBulk(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK_NEW: { return migrateCommandMoveOrCopyBulkNew(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY: { return migrateCommandMoveOrCopy(oldPendingCommand); } case PENDING_COMMAND_EMPTY_TRASH: { return migrateCommandEmptyTrash(); } case PENDING_COMMAND_EXPUNGE: { return migrateCommandExpunge(oldPendingCommand); } default: { throw new IllegalArgumentException("Tried to migrate unknown pending command!"); } } } }
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG: { return migrateCommandSetFlag(oldPendingCommand); } case PENDING_COMMAND_MARK_ALL_AS_READ: { return migrateCommandMarkAllAsRead(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK: { return migrateCommandMoveOrCopyBulk(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK_NEW: { return migrateCommandMoveOrCopyBulkNew(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY: { return migrateCommandMoveOrCopy(oldPendingCommand); } case PENDING_COMMAND_EMPTY_TRASH: { return migrateCommandEmptyTrash(); } case PENDING_COMMAND_EXPUNGE: { return migrateCommandExpunge(oldPendingCommand); } default: { throw new IllegalArgumentException("Tried to migrate unknown pending command!"); } } }  }
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG: { return migrateCommandSetFlag(oldPendingCommand); } case PENDING_COMMAND_MARK_ALL_AS_READ: { return migrateCommandMarkAllAsRead(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK: { return migrateCommandMoveOrCopyBulk(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK_NEW: { return migrateCommandMoveOrCopyBulkNew(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY: { return migrateCommandMoveOrCopy(oldPendingCommand); } case PENDING_COMMAND_EMPTY_TRASH: { return migrateCommandEmptyTrash(); } case PENDING_COMMAND_EXPUNGE: { return migrateCommandExpunge(oldPendingCommand); } default: { throw new IllegalArgumentException("Tried to migrate unknown pending command!"); } } }   }
MigrationTo60 { @VisibleForTesting static PendingCommand migratePendingCommand(OldPendingCommand oldPendingCommand) { switch (oldPendingCommand.command) { case PENDING_COMMAND_APPEND: { return migrateCommandAppend(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG_BULK: { return migrateCommandSetFlagBulk(oldPendingCommand); } case PENDING_COMMAND_SET_FLAG: { return migrateCommandSetFlag(oldPendingCommand); } case PENDING_COMMAND_MARK_ALL_AS_READ: { return migrateCommandMarkAllAsRead(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK: { return migrateCommandMoveOrCopyBulk(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY_BULK_NEW: { return migrateCommandMoveOrCopyBulkNew(oldPendingCommand); } case PENDING_COMMAND_MOVE_OR_COPY: { return migrateCommandMoveOrCopy(oldPendingCommand); } case PENDING_COMMAND_EMPTY_TRASH: { return migrateCommandEmptyTrash(); } case PENDING_COMMAND_EXPUNGE: { return migrateCommandExpunge(oldPendingCommand); } default: { throw new IllegalArgumentException("Tried to migrate unknown pending command!"); } } }    }