@Test public void givenSendReadReceiptJobDataWithoutThreadIdAndThreadIdNotFound_whenIMigrate_thenIGetAFailingJob() { SendReadReceiptJob job = new SendReadReceiptJob(1, RecipientId.from(2), new ArrayList<>()); JobMigration.JobData jobData = new JobMigration.JobData(job.getFactoryKey(), "asdf", new Data.Builder() .putString("recipient", RecipientId.from(2).serialize()) .putLongArray("message_ids", new long[]{}) .putLong("timestamp", 292837649).build()); when(mockDatabase.getThreadForMessageId(anyLong())).thenReturn(-1L); JobMigration.JobData result = testSubject.migrate(jobData); assertEquals("FailingJob", result.getFactoryKey()); }
@Override protected @NonNull JobData migrate(@NonNull JobData jobData) { if ("SendReadReceiptJob".equals(jobData.getFactoryKey())) { return migrateSendReadReceiptJob(mmsSmsDatabase, jobData); } return jobData; }
SendReadReceiptsJobMigration extends JobMigration { @Override protected @NonNull JobData migrate(@NonNull JobData jobData) { if ("SendReadReceiptJob".equals(jobData.getFactoryKey())) { return migrateSendReadReceiptJob(mmsSmsDatabase, jobData); } return jobData; } }
SendReadReceiptsJobMigration extends JobMigration { @Override protected @NonNull JobData migrate(@NonNull JobData jobData) { if ("SendReadReceiptJob".equals(jobData.getFactoryKey())) { return migrateSendReadReceiptJob(mmsSmsDatabase, jobData); } return jobData; } SendReadReceiptsJobMigration(@NonNull MmsSmsDatabase mmsSmsDatabase); }
SendReadReceiptsJobMigration extends JobMigration { @Override protected @NonNull JobData migrate(@NonNull JobData jobData) { if ("SendReadReceiptJob".equals(jobData.getFactoryKey())) { return migrateSendReadReceiptJob(mmsSmsDatabase, jobData); } return jobData; } SendReadReceiptsJobMigration(@NonNull MmsSmsDatabase mmsSmsDatabase);  }
SendReadReceiptsJobMigration extends JobMigration { @Override protected @NonNull JobData migrate(@NonNull JobData jobData) { if ("SendReadReceiptJob".equals(jobData.getFactoryKey())) { return migrateSendReadReceiptJob(mmsSmsDatabase, jobData); } return jobData; } SendReadReceiptsJobMigration(@NonNull MmsSmsDatabase mmsSmsDatabase);   }