Fix IllegalArgumentException in test (#3799)

This commit is contained in:
David Perez 2024-08-21 12:33:33 -05:00 committed by GitHub
parent 17fd3ec0f0
commit 3b3b9ef33b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4210,29 +4210,24 @@ class VaultRepositoryTest {
val userId = "userId" val userId = "userId"
val fido2CredentialStore: Fido2CredentialStore = mockk() val fido2CredentialStore: Fido2CredentialStore = mockk()
val relyingPartyId = "relyingPartyId" val relyingPartyId = "relyingPartyId"
val expected: Result<List<Fido2CredentialAutofillView>> = mockk() val expected: List<Fido2CredentialAutofillView> = mockk()
coEvery { coEvery {
vaultSdkSource.silentlyDiscoverCredentials( vaultSdkSource.silentlyDiscoverCredentials(
userId = userId, userId = userId,
fido2CredentialStore = fido2CredentialStore, fido2CredentialStore = fido2CredentialStore,
relyingPartyId = relyingPartyId, relyingPartyId = relyingPartyId,
) )
} returns expected } returns expected.asSuccess()
turbineScope { val result = vaultRepository.silentlyDiscoverCredentials(
val result = vaultRepository.silentlyDiscoverCredentials( userId = userId,
userId = userId, fido2CredentialStore = fido2CredentialStore,
fido2CredentialStore = fido2CredentialStore, relyingPartyId = relyingPartyId,
relyingPartyId = relyingPartyId, )
)
assertEquals( assertEquals(expected.asSuccess(), result)
expected,
result,
)
}
coVerify { coVerify(exactly = 1) {
vaultSdkSource.silentlyDiscoverCredentials( vaultSdkSource.silentlyDiscoverCredentials(
userId = userId, userId = userId,
fido2CredentialStore = fido2CredentialStore, fido2CredentialStore = fido2CredentialStore,