Add metrics for registration lock flow

This commit is contained in:
Katherine Yen
2023-03-09 09:07:21 -08:00
committed by GitHub
parent c06313dd2e
commit 46fef4082c
10 changed files with 157 additions and 39 deletions

View File

@@ -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);

View File

@@ -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")

View File

@@ -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")