mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 03:28:00 +01:00
Identify accounts for which to delete keys by UUID.
This commit is contained in:
committed by
Jon Chambers
parent
d09dcc90fe
commit
be20c04cd8
@@ -116,7 +116,7 @@ public class KeysDynamoDbTest {
|
||||
assertEquals(2, keysDynamoDb.getCount(account, DEVICE_ID));
|
||||
assertEquals(1, keysDynamoDb.getCount(account, DEVICE_ID + 1));
|
||||
|
||||
keysDynamoDb.delete(account);
|
||||
keysDynamoDb.delete(account.getUuid());
|
||||
|
||||
assertEquals(0, keysDynamoDb.getCount(account, DEVICE_ID));
|
||||
assertEquals(0, keysDynamoDb.getCount(account, DEVICE_ID + 1));
|
||||
@@ -130,7 +130,7 @@ public class KeysDynamoDbTest {
|
||||
assertEquals(2, keysDynamoDb.getCount(account, DEVICE_ID));
|
||||
assertEquals(1, keysDynamoDb.getCount(account, DEVICE_ID + 1));
|
||||
|
||||
keysDynamoDb.delete(account, DEVICE_ID);
|
||||
keysDynamoDb.delete(account.getUuid(), DEVICE_ID);
|
||||
|
||||
assertEquals(0, keysDynamoDb.getCount(account, DEVICE_ID));
|
||||
assertEquals(1, keysDynamoDb.getCount(account, DEVICE_ID + 1));
|
||||
|
||||
@@ -7,7 +7,6 @@ package org.whispersystems.textsecuregcm.tests.controllers;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.argThat;
|
||||
import static org.mockito.Mockito.clearInvocations;
|
||||
import static org.mockito.Mockito.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
@@ -382,9 +381,7 @@ class DeviceControllerTest {
|
||||
verify(messagesManager, times(2)).clear(AuthHelper.VALID_UUID, deviceId);
|
||||
verify(accountsManager, times(1)).update(eq(AuthHelper.VALID_ACCOUNT), any());
|
||||
verify(AuthHelper.VALID_ACCOUNT).removeDevice(deviceId);
|
||||
|
||||
// The account instance may have changed as part of a call to `AccountManager#update`
|
||||
verify(keys).delete(argThat(account -> account.getUuid().equals(AuthHelper.VALID_UUID)), eq(deviceId));
|
||||
verify(keys).delete(AuthHelper.VALID_UUID, deviceId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user