mirror of
https://github.com/bitwarden/android.git
synced 2026-11-19 17:40:12 -06:00
Add VaultSdkSource.getUserEncryptionKey (#545)
This commit is contained in:
committed by
Álison Fernandes
parent
2d4427a7cf
commit
6686d98e34
@@ -60,6 +60,25 @@ class VaultSdkSourceTest {
|
||||
verify { sdkClientManager.destroyClient(userId = userId) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `getUserEncryptionKey should call SDK and return a Result with correct data`() =
|
||||
runBlocking {
|
||||
val userId = "userId"
|
||||
val expectedResult = "userEncryptionKey"
|
||||
coEvery {
|
||||
clientCrypto.getUserEncryptionKey()
|
||||
} returns expectedResult
|
||||
val result = vaultSdkSource.getUserEncryptionKey(userId = userId)
|
||||
assertEquals(
|
||||
expectedResult.asSuccess(),
|
||||
result,
|
||||
)
|
||||
coVerify {
|
||||
clientCrypto.getUserEncryptionKey()
|
||||
}
|
||||
verify { sdkClientManager.getOrCreateClient(userId = userId) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `initializeUserCrypto with sdk success should return InitializeCryptoResult Success`() =
|
||||
runBlocking {
|
||||
|
||||
Reference in New Issue
Block a user