Search in sources :

Example 6 with IdDifferenceResult

use of org.thoughtcrime.securesms.storage.StorageSyncHelper.IdDifferenceResult in project Signal-Android by WhisperSystems.

the class StorageSyncHelperTest method findIdDifference_typeMismatch_allOverlap.

@Test
public void findIdDifference_typeMismatch_allOverlap() {
    IdDifferenceResult result = StorageSyncHelper.findIdDifference(keyListOf(new HashMap<Integer, Integer>() {

        {
            put(100, 1);
            put(200, 2);
        }
    }), keyListOf(new HashMap<Integer, Integer>() {

        {
            put(100, 1);
            put(200, 1);
        }
    }));
    assertTrue(result.getLocalOnlyIds().isEmpty());
    assertTrue(result.getRemoteOnlyIds().isEmpty());
    assertTrue(result.hasTypeMismatches());
}
Also used : IdDifferenceResult(org.thoughtcrime.securesms.storage.StorageSyncHelper.IdDifferenceResult) HashMap(java.util.HashMap) PrepareForTest(org.powermock.core.classloader.annotations.PrepareForTest) Test(org.junit.Test)

Aggregations

IdDifferenceResult (org.thoughtcrime.securesms.storage.StorageSyncHelper.IdDifferenceResult)6 Test (org.junit.Test)5 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)5 HashMap (java.util.HashMap)2 LinkedList (java.util.LinkedList)1 SQLiteDatabase (net.zetetic.database.sqlcipher.SQLiteDatabase)1 UnknownStorageIdDatabase (org.thoughtcrime.securesms.database.UnknownStorageIdDatabase)1 Recipient (org.thoughtcrime.securesms.recipients.Recipient)1 AccountRecordProcessor (org.thoughtcrime.securesms.storage.AccountRecordProcessor)1 ContactRecordProcessor (org.thoughtcrime.securesms.storage.ContactRecordProcessor)1 GroupV1RecordProcessor (org.thoughtcrime.securesms.storage.GroupV1RecordProcessor)1 GroupV2RecordProcessor (org.thoughtcrime.securesms.storage.GroupV2RecordProcessor)1 WriteOperationResult (org.thoughtcrime.securesms.storage.StorageSyncHelper.WriteOperationResult)1 RetryLaterException (org.thoughtcrime.securesms.transport.RetryLaterException)1 Stopwatch (org.thoughtcrime.securesms.util.Stopwatch)1 SignalServiceAccountManager (org.whispersystems.signalservice.api.SignalServiceAccountManager)1 SignalAccountRecord (org.whispersystems.signalservice.api.storage.SignalAccountRecord)1 SignalContactRecord (org.whispersystems.signalservice.api.storage.SignalContactRecord)1 SignalGroupV1Record (org.whispersystems.signalservice.api.storage.SignalGroupV1Record)1 SignalGroupV2Record (org.whispersystems.signalservice.api.storage.SignalGroupV2Record)1