mirror of
https://github.com/bitwarden/android.git
synced 2026-11-19 17:40:12 -06:00
Add support for encrypting sends (#515)
This commit is contained in:
committed by
Álison Fernandes
parent
9aca107183
commit
d00e7d69ea
@@ -403,6 +403,24 @@ class VaultSdkSourceTest {
|
||||
verify { sdkClientManager.getOrCreateClient(userId = userId) }
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `encryptSend should call SDK and return correct data wrapped in a Result`() = runBlocking {
|
||||
val userId = "userId"
|
||||
val expectedResult = mockk<Send>()
|
||||
val mockSendView = mockk<SendView>()
|
||||
coEvery { clientVault.sends().encrypt(send = mockSendView) } returns expectedResult
|
||||
|
||||
val result = vaultSdkSource.encryptSend(
|
||||
userId = userId,
|
||||
sendView = mockSendView,
|
||||
)
|
||||
|
||||
assertEquals(expectedResult.asSuccess(), result)
|
||||
coVerify {
|
||||
clientVault.sends().encrypt(send = mockSendView)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `decryptSend should call SDK and return correct data wrapped in a Result`() =
|
||||
runBlocking {
|
||||
|
||||
Reference in New Issue
Block a user