Avoid modification of Account from @ReadOnly endpoint

This commit is contained in:
ravi-signal
2024-02-28 15:18:12 -06:00
committed by GitHub
parent 55ca4e93c4
commit 2adf1e5017
2 changed files with 18 additions and 2 deletions

View File

@@ -220,10 +220,12 @@ class PushNotificationManagerTest {
void testSendNotificationUnregisteredFcm() {
final Account account = mock(Account.class);
final Device device = mock(Device.class);
final UUID aci = UUID.randomUUID();
when(device.getId()).thenReturn(Device.PRIMARY_ID);
when(device.getGcmId()).thenReturn("token");
when(account.getDevice(Device.PRIMARY_ID)).thenReturn(Optional.of(device));
when(account.getUuid()).thenReturn(aci);
when(accountsManager.getByAccountIdentifier(aci)).thenReturn(Optional.of(account));
final PushNotification pushNotification = new PushNotification(
"token", PushNotification.TokenType.FCM, PushNotification.NotificationType.NOTIFICATION, null, account, device, true);