mirror of
https://github.com/bitwarden/android.git
synced 2026-11-19 17:40:12 -06:00
Update the Bitwarden SDK (#1271)
This commit is contained in:
committed by
Álison Fernandes
parent
2523239557
commit
cec70a9c64
@@ -163,12 +163,14 @@ class AuthSdkSourceTest {
|
||||
fun `makeRegisterTdeKeysAndUnlockVault should call SDK and return a Result with the correct data`() =
|
||||
runBlocking {
|
||||
val userId = "userId"
|
||||
val email = "email"
|
||||
val orgPublicKey = "orgPublicKey"
|
||||
val rememberDevice = true
|
||||
val expectedResult = mockk<RegisterTdeKeyResponse>()
|
||||
coEvery { sdkClientManager.getOrCreateClient(userId = userId) } returns client
|
||||
coEvery {
|
||||
clientAuth.makeRegisterTdeKeys(
|
||||
email = email,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = rememberDevice,
|
||||
)
|
||||
@@ -176,12 +178,14 @@ class AuthSdkSourceTest {
|
||||
|
||||
val result = authSkdSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = userId,
|
||||
email = email,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = rememberDevice,
|
||||
)
|
||||
assertEquals(expectedResult.asSuccess(), result)
|
||||
coVerify(exactly = 1) {
|
||||
clientAuth.makeRegisterTdeKeys(
|
||||
email = email,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = rememberDevice,
|
||||
)
|
||||
|
||||
@@ -823,6 +823,7 @@ class AuthRepositoryTest {
|
||||
coEvery {
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -836,6 +837,7 @@ class AuthRepositoryTest {
|
||||
organizationService.getOrganizationKeys(orgId)
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -877,6 +879,7 @@ class AuthRepositoryTest {
|
||||
coEvery {
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -896,6 +899,7 @@ class AuthRepositoryTest {
|
||||
organizationService.getOrganizationKeys(orgId)
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -941,6 +945,7 @@ class AuthRepositoryTest {
|
||||
coEvery {
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -968,6 +973,7 @@ class AuthRepositoryTest {
|
||||
organizationService.getOrganizationKeys(orgId)
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -1021,6 +1027,7 @@ class AuthRepositoryTest {
|
||||
coEvery {
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -1050,6 +1057,7 @@ class AuthRepositoryTest {
|
||||
organizationService.getOrganizationKeys(orgId)
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -1104,6 +1112,7 @@ class AuthRepositoryTest {
|
||||
coEvery {
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
@@ -1139,6 +1148,7 @@ class AuthRepositoryTest {
|
||||
organizationService.getOrganizationKeys(orgId)
|
||||
authSdkSource.makeRegisterTdeKeysAndUnlockVault(
|
||||
userId = USER_ID_1,
|
||||
email = EMAIL,
|
||||
orgPublicKey = orgPublicKey,
|
||||
rememberDevice = shouldTrustDevice,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user