@Test public void migrate_sendDeliveryReceiptJob_good() throws Exception { JobData testData = new JobData("SendDeliveryReceiptJob", null, new Data.Builder().putString("recipient", "1") .putLong("message_id", 1) .putLong("timestamp", 2) .build()); RecipientIdFollowUpJobMigration subject = new RecipientIdFollowUpJobMigration(); JobData converted = subject.migrate(testData); assertEquals("SendDeliveryReceiptJob", converted.getFactoryKey()); assertNull(converted.getQueueKey()); assertEquals("1", converted.getData().getString("recipient")); assertEquals(1, converted.getData().getLong("message_id")); assertEquals(2, converted.getData().getLong("timestamp")); new SendDeliveryReceiptJob.Factory().create(mock(Job.Parameters.class), converted.getData()); }
@Override protected @NonNull JobData migrate(@NonNull JobData jobData) { switch(jobData.getFactoryKey()) { case "RequestGroupInfoJob": return migrateRequestGroupInfoJob(jobData); case "SendDeliveryReceiptJob": return migrateSendDeliveryReceiptJob(jobData); default: return jobData; } }
RecipientIdFollowUpJobMigration extends JobMigration { @Override protected @NonNull JobData migrate(@NonNull JobData jobData) { switch(jobData.getFactoryKey()) { case "RequestGroupInfoJob": return migrateRequestGroupInfoJob(jobData); case "SendDeliveryReceiptJob": return migrateSendDeliveryReceiptJob(jobData); default: return jobData; } } }
RecipientIdFollowUpJobMigration extends JobMigration { @Override protected @NonNull JobData migrate(@NonNull JobData jobData) { switch(jobData.getFactoryKey()) { case "RequestGroupInfoJob": return migrateRequestGroupInfoJob(jobData); case "SendDeliveryReceiptJob": return migrateSendDeliveryReceiptJob(jobData); default: return jobData; } } RecipientIdFollowUpJobMigration();   RecipientIdFollowUpJobMigration(int endVersion); }
RecipientIdFollowUpJobMigration extends JobMigration { @Override protected @NonNull JobData migrate(@NonNull JobData jobData) { switch(jobData.getFactoryKey()) { case "RequestGroupInfoJob": return migrateRequestGroupInfoJob(jobData); case "SendDeliveryReceiptJob": return migrateSendDeliveryReceiptJob(jobData); default: return jobData; } } RecipientIdFollowUpJobMigration();   RecipientIdFollowUpJobMigration(int endVersion);  }
RecipientIdFollowUpJobMigration extends JobMigration { @Override protected @NonNull JobData migrate(@NonNull JobData jobData) { switch(jobData.getFactoryKey()) { case "RequestGroupInfoJob": return migrateRequestGroupInfoJob(jobData); case "SendDeliveryReceiptJob": return migrateSendDeliveryReceiptJob(jobData); default: return jobData; } } RecipientIdFollowUpJobMigration();   RecipientIdFollowUpJobMigration(int endVersion);   }