mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 09:28:30 +01:00
Remove number from ReportMessageManager#store
This commit is contained in:
committed by
Jon Chambers
parent
5816f76bbe
commit
7b3703506b
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* Copyright 2021-2022 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.whispersystems.textsecuregcm.storage;
|
||||
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
@@ -34,7 +39,7 @@ class MessagesManagerTest {
|
||||
|
||||
messagesManager.insert(destinationUuid, 1L, message);
|
||||
|
||||
verify(reportMessageManager).store(eq(sourceNumber), eq(sourceAci.toString()), any(UUID.class));
|
||||
verify(reportMessageManager).store(eq(sourceAci.toString()), any(UUID.class));
|
||||
|
||||
final Envelope syncMessage = Envelope.newBuilder(message)
|
||||
.setSourceUuid(destinationUuid.toString())
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
/*
|
||||
* Copyright 2021-2022 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.whispersystems.textsecuregcm.storage;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
|
||||
@@ -6,7 +11,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.Mockito.doThrow;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.times;
|
||||
import static org.mockito.Mockito.verify;
|
||||
import static org.mockito.Mockito.verifyNoInteractions;
|
||||
import static org.mockito.Mockito.when;
|
||||
@@ -56,18 +60,18 @@ class ReportMessageManagerTest {
|
||||
|
||||
@Test
|
||||
void testStore() {
|
||||
assertDoesNotThrow(() -> reportMessageManager.store(null, null, messageGuid));
|
||||
assertDoesNotThrow(() -> reportMessageManager.store(null, messageGuid));
|
||||
|
||||
verifyNoInteractions(reportMessageDynamoDb);
|
||||
|
||||
reportMessageManager.store(sourceNumber, sourceAci.toString(), messageGuid);
|
||||
reportMessageManager.store(sourceAci.toString(), messageGuid);
|
||||
|
||||
verify(reportMessageDynamoDb, times(2)).store(any());
|
||||
verify(reportMessageDynamoDb).store(any());
|
||||
|
||||
doThrow(RuntimeException.class)
|
||||
.when(reportMessageDynamoDb).store(any());
|
||||
|
||||
assertDoesNotThrow(() -> reportMessageManager.store(sourceNumber, sourceAci.toString(), messageGuid));
|
||||
assertDoesNotThrow(() -> reportMessageManager.store(sourceAci.toString(), messageGuid));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user