@Test public void migrate_requestGroupInfoJob_bad() throws Exception { JobData testData = new JobData("RequestGroupInfoJob", null, new Data.Builder().putString("source", "1") .build()); RecipientIdFollowUpJobMigration subject = new RecipientIdFollowUpJobMigration(); JobData converted = subject.migrate(testData); assertEquals("FailingJob", converted.getFactoryKey()); assertNull(converted.getQueueKey()); new FailingJob.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);   }