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