mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 17:38:25 +01:00
Add metrics for registration lock flow
This commit is contained in:
@@ -1448,7 +1448,7 @@ class AccountControllerTest {
|
||||
.thenReturn(CompletableFuture.completedFuture(true));
|
||||
|
||||
final StoredRegistrationLock existingRegistrationLock = mock(StoredRegistrationLock.class);
|
||||
when(existingRegistrationLock.requiresClientRegistrationLock()).thenReturn(false);
|
||||
when(existingRegistrationLock.getStatus()).thenReturn(StoredRegistrationLock.Status.ABSENT);
|
||||
|
||||
final Account existingAccount = mock(Account.class);
|
||||
when(existingAccount.getNumber()).thenReturn(number);
|
||||
@@ -1482,7 +1482,7 @@ class AccountControllerTest {
|
||||
.thenReturn(CompletableFuture.completedFuture(true));
|
||||
|
||||
final StoredRegistrationLock existingRegistrationLock = mock(StoredRegistrationLock.class);
|
||||
when(existingRegistrationLock.requiresClientRegistrationLock()).thenReturn(true);
|
||||
when(existingRegistrationLock.getStatus()).thenReturn(StoredRegistrationLock.Status.REQUIRED);
|
||||
|
||||
final UUID existingUuid = UUID.randomUUID();
|
||||
final Account existingAccount = mock(Account.class);
|
||||
@@ -1521,7 +1521,7 @@ class AccountControllerTest {
|
||||
.thenReturn(CompletableFuture.completedFuture(true));
|
||||
|
||||
final StoredRegistrationLock existingRegistrationLock = mock(StoredRegistrationLock.class);
|
||||
when(existingRegistrationLock.requiresClientRegistrationLock()).thenReturn(true);
|
||||
when(existingRegistrationLock.getStatus()).thenReturn(StoredRegistrationLock.Status.REQUIRED);
|
||||
when(existingRegistrationLock.verify(anyString())).thenReturn(false);
|
||||
|
||||
UUID existingUuid = UUID.randomUUID();
|
||||
@@ -1561,7 +1561,7 @@ class AccountControllerTest {
|
||||
.thenReturn(CompletableFuture.completedFuture(true));
|
||||
|
||||
final StoredRegistrationLock existingRegistrationLock = mock(StoredRegistrationLock.class);
|
||||
when(existingRegistrationLock.requiresClientRegistrationLock()).thenReturn(true);
|
||||
when(existingRegistrationLock.getStatus()).thenReturn(StoredRegistrationLock.Status.REQUIRED);
|
||||
when(existingRegistrationLock.verify(reglock)).thenReturn(true);
|
||||
|
||||
final Account existingAccount = mock(Account.class);
|
||||
|
||||
@@ -295,7 +295,7 @@ class AccountControllerV2Test {
|
||||
case RATE_LIMITED -> new RateLimitExceededException(null, true);
|
||||
};
|
||||
doThrow(e)
|
||||
.when(registrationLockVerificationManager).verifyRegistrationLock(any(), any());
|
||||
.when(registrationLockVerificationManager).verifyRegistrationLock(any(), any(), any(), any(), any());
|
||||
|
||||
final Invocation.Builder request = resources.getJerseyTest()
|
||||
.target("/v2/accounts/number")
|
||||
|
||||
@@ -265,7 +265,7 @@ class RegistrationControllerTest {
|
||||
case RATE_LIMITED -> new RateLimitExceededException(null, true);
|
||||
};
|
||||
doThrow(e)
|
||||
.when(registrationLockVerificationManager).verifyRegistrationLock(any(), any());
|
||||
.when(registrationLockVerificationManager).verifyRegistrationLock(any(), any(), any(), any(), any());
|
||||
|
||||
final Invocation.Builder request = resources.getJerseyTest()
|
||||
.target("/v1/registration")
|
||||
|
||||
Reference in New Issue
Block a user