mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
Add read and viewed receipts to the MSL.
This commit is contained in:
committed by
Alex Hart
parent
3d0e15e2b8
commit
0921ebe5f1
@@ -23,7 +23,7 @@ public class SendReadReceiptsJobMigrationTest {
|
||||
@Test
|
||||
public void givenSendReadReceiptJobDataWithoutThreadIdAndThreadIdFound_whenIMigrate_thenIInsertThreadId() {
|
||||
// GIVEN
|
||||
SendReadReceiptJob job = new SendReadReceiptJob(1, RecipientId.from(2), new ArrayList<>());
|
||||
SendReadReceiptJob job = new SendReadReceiptJob(1, RecipientId.from(2), new ArrayList<>(), new ArrayList<>());
|
||||
JobMigration.JobData jobData = new JobMigration.JobData(job.getFactoryKey(),
|
||||
"asdf",
|
||||
new Data.Builder()
|
||||
@@ -45,7 +45,7 @@ public class SendReadReceiptsJobMigrationTest {
|
||||
@Test
|
||||
public void givenSendReadReceiptJobDataWithoutThreadIdAndThreadIdNotFound_whenIMigrate_thenIGetAFailingJob() {
|
||||
// GIVEN
|
||||
SendReadReceiptJob job = new SendReadReceiptJob(1, RecipientId.from(2), new ArrayList<>());
|
||||
SendReadReceiptJob job = new SendReadReceiptJob(1, RecipientId.from(2), new ArrayList<>(), new ArrayList<>());
|
||||
JobMigration.JobData jobData = new JobMigration.JobData(job.getFactoryKey(),
|
||||
"asdf",
|
||||
new Data.Builder()
|
||||
@@ -64,7 +64,7 @@ public class SendReadReceiptsJobMigrationTest {
|
||||
@Test
|
||||
public void givenSendReadReceiptJobDataWithThreadId_whenIMigrate_thenIDoNotReplace() {
|
||||
// GIVEN
|
||||
SendReadReceiptJob job = new SendReadReceiptJob(1, RecipientId.from(2), new ArrayList<>());
|
||||
SendReadReceiptJob job = new SendReadReceiptJob(1, RecipientId.from(2), new ArrayList<>(), new ArrayList<>());
|
||||
JobMigration.JobData jobData = new JobMigration.JobData(job.getFactoryKey(), "asdf", job.serialize());
|
||||
|
||||
// WHEN
|
||||
|
||||
@@ -13,6 +13,7 @@ import org.mockito.stubbing.Answer;
|
||||
import org.powermock.core.classloader.annotations.PrepareForTest;
|
||||
import org.powermock.modules.junit4.PowerMockRunner;
|
||||
import org.thoughtcrime.securesms.database.MessageDatabase;
|
||||
import org.thoughtcrime.securesms.database.model.MessageId;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.jobmanager.Data;
|
||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||
@@ -94,7 +95,8 @@ public class MarkReadReceiverTest {
|
||||
|
||||
private MessageDatabase.MarkedMessageInfo createMarkedMessageInfo(long threadId, @NonNull RecipientId recipientId) {
|
||||
return new MessageDatabase.MarkedMessageInfo(threadId,
|
||||
new MessageDatabase.SyncMessageId(recipientId, 0),
|
||||
new MessageDatabase.ExpirationInfo(0, 0, 0, false));
|
||||
new MessageDatabase.SyncMessageId(recipientId, 0),
|
||||
new MessageId(1, true),
|
||||
new MessageDatabase.ExpirationInfo(0, 0, 0, false));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user