From f86fdaa15216a6800d06690bd8ebe8cb15ad1304 Mon Sep 17 00:00:00 2001 From: Mojtaba Chenani Date: Tue, 18 Jun 2024 14:41:43 +0200 Subject: [PATCH] fix tests --- .../kotlin/com/wire/android/di/accountScoped/UserModule.kt | 4 ++-- .../android/ui/settings/devices/DeviceDetailsScreen.kt | 2 +- .../ui/settings/devices/EndToEndIdentityCertificateItem.kt | 4 ++-- .../devices/e2ei/E2eiCertificateDetailsViewModel.kt | 4 ++-- .../userprofile/other/OtherUserProfileScreenViewModel.kt | 4 ++-- .../other/OtherUserProfileViewModelArrangement.kt | 7 +++---- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/src/main/kotlin/com/wire/android/di/accountScoped/UserModule.kt b/app/src/main/kotlin/com/wire/android/di/accountScoped/UserModule.kt index 6449b66f1d0..3fa653b074f 100644 --- a/app/src/main/kotlin/com/wire/android/di/accountScoped/UserModule.kt +++ b/app/src/main/kotlin/com/wire/android/di/accountScoped/UserModule.kt @@ -29,7 +29,7 @@ import com.wire.kalium.logic.feature.conversation.GetAllContactsNotInConversatio import com.wire.kalium.logic.feature.e2ei.CertificateRevocationListCheckWorker import com.wire.kalium.logic.feature.e2ei.usecase.GetMLSClientIdentityUseCase import com.wire.kalium.logic.feature.e2ei.usecase.GetMembersE2EICertificateStatusesUseCase -import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificateStatusUseCase +import com.wire.kalium.logic.feature.e2ei.usecase.IsOtherUserE2EIVerifiedUseCase import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificatesUseCase import com.wire.kalium.logic.feature.e2ei.usecase.ObserveCertificateRevocationForSelfClientUseCase import com.wire.kalium.logic.feature.featureConfig.FeatureFlagsSyncWorker @@ -217,7 +217,7 @@ class UserModule { @ViewModelScoped @Provides - fun provideGetUserE2eiCertificateStatusUseCase(userScope: UserScope): GetUserE2eiCertificateStatusUseCase = + fun provideGetUserE2eiCertificateStatusUseCase(userScope: UserScope): IsOtherUserE2EIVerifiedUseCase = userScope.getUserE2eiCertificateStatus @ViewModelScoped diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt index 42fe59330aa..2b294ed423e 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsScreen.kt @@ -584,7 +584,7 @@ fun PreviewDeviceDetailsScreen() { x509Identity = X509Identity( displayName = "", domain = "", - certificateDetail = "", + certificate = "", serialNumber = "e5:d5:e6:75:7e:04:86:07:14:3c:a0:ed:9a:8d:e4:fd", notBefore = Instant.DISTANT_PAST, notAfter = Instant.DISTANT_FUTURE diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/EndToEndIdentityCertificateItem.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/EndToEndIdentityCertificateItem.kt index 866890519c7..c2537fce2c5 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/EndToEndIdentityCertificateItem.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/EndToEndIdentityCertificateItem.kt @@ -221,7 +221,7 @@ fun PreviewEndToEndIdentityCertificateItem() { x509Identity = X509Identity( displayName = "", domain = "", - certificateDetail = "", + certificate = "", serialNumber = "e5:d5:e6:75:7e:04:86:07:14:3c:a0:ed:9a:8d:e4:fd", notBefore = Instant.DISTANT_PAST, notAfter = Instant.DISTANT_FUTURE @@ -246,7 +246,7 @@ fun PreviewEndToEndIdentityCertificateSelfItem() { x509Identity = X509Identity( displayName = "", domain = "", - certificateDetail = "", + certificate = "", serialNumber = "e5:d5:e6:75:7e:04:86:07:14:3c:a0:ed:9a:8d:e4:fd", notBefore = Instant.DISTANT_PAST, notAfter = Instant.DISTANT_FUTURE diff --git a/app/src/main/kotlin/com/wire/android/ui/settings/devices/e2ei/E2eiCertificateDetailsViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/settings/devices/e2ei/E2eiCertificateDetailsViewModel.kt index e5b05a4fdf7..6a00c4b42d8 100644 --- a/app/src/main/kotlin/com/wire/android/ui/settings/devices/e2ei/E2eiCertificateDetailsViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/settings/devices/e2ei/E2eiCertificateDetailsViewModel.kt @@ -63,7 +63,7 @@ class E2eiCertificateDetailsViewModel @Inject constructor( navArgs.certificateDetails.certificate is E2EICertificateDetails.AfterLoginCertificateDetails -> - navArgs.certificateDetails.mlsClientIdentity.x509Identity!!.certificateDetail + navArgs.certificateDetails.mlsClientIdentity.x509Identity!!.certificate } fun userHandle() = @@ -72,7 +72,7 @@ class E2eiCertificateDetailsViewModel @Inject constructor( selfUserHandle is E2EICertificateDetails.AfterLoginCertificateDetails -> - navArgs.certificateDetails.mlsClientIdentity.x509Identity!!.certificateDetail + navArgs.certificateDetails.mlsClientIdentity.x509Identity!!.certificate } fun getCertificateName(): String { diff --git a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModel.kt b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModel.kt index efce0630f72..a2099b87d91 100644 --- a/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModel.kt +++ b/app/src/main/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModel.kt @@ -69,7 +69,7 @@ import com.wire.kalium.logic.feature.conversation.UpdateConversationArchivedStat import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleResult import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationMutedStatusUseCase -import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificateStatusUseCase +import com.wire.kalium.logic.feature.e2ei.usecase.IsOtherUserE2EIVerifiedUseCase import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificatesUseCase import com.wire.kalium.logic.feature.user.GetUserInfoResult import com.wire.kalium.logic.feature.user.ObserveUserInfoUseCase @@ -104,7 +104,7 @@ class OtherUserProfileScreenViewModel @Inject constructor( private val fetchUsersClients: FetchUsersClientsFromRemoteUseCase, private val clearConversationContentUseCase: ClearConversationContentUseCase, private val updateConversationArchivedStatus: UpdateConversationArchivedStatusUseCase, - private val getUserE2eiCertificateStatus: GetUserE2eiCertificateStatusUseCase, + private val getUserE2eiCertificateStatus: IsOtherUserE2EIVerifiedUseCase, private val getUserE2eiCertificates: GetUserE2eiCertificatesUseCase, private val isOneToOneConversationCreated: IsOneToOneConversationCreatedUseCase, savedStateHandle: SavedStateHandle diff --git a/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileViewModelArrangement.kt b/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileViewModelArrangement.kt index 3dd80464f49..304c3489964 100644 --- a/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileViewModelArrangement.kt +++ b/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileViewModelArrangement.kt @@ -45,8 +45,7 @@ import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleRe import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationMutedStatusUseCase import com.wire.kalium.logic.feature.e2ei.CertificateStatus -import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificateStatusResult -import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificateStatusUseCase +import com.wire.kalium.logic.feature.e2ei.usecase.IsOtherUserE2EIVerifiedUseCase import com.wire.kalium.logic.feature.e2ei.usecase.GetUserE2eiCertificatesUseCase import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import com.wire.kalium.logic.feature.user.GetUserInfoResult @@ -108,7 +107,7 @@ internal class OtherUserProfileViewModelArrangement { lateinit var updateConversationArchivedStatus: UpdateConversationArchivedStatusUseCase @MockK - lateinit var getUserE2eiCertificateStatus: GetUserE2eiCertificateStatusUseCase + lateinit var getUserE2eiCertificateStatus: IsOtherUserE2EIVerifiedUseCase @MockK lateinit var getUserE2eiCertificates: GetUserE2eiCertificatesUseCase @@ -164,7 +163,7 @@ internal class OtherUserProfileViewModelArrangement { coEvery { getOneToOneConversation(USER_ID) } returns flowOf( GetOneToOneConversationUseCase.Result.Success(OtherUserProfileScreenViewModelTest.CONVERSATION) ) - coEvery { getUserE2eiCertificateStatus.invoke(any()) } returns GetUserE2eiCertificateStatusResult.Success(CertificateStatus.VALID) + coEvery { getUserE2eiCertificateStatus.invoke(any()) } returns true coEvery { getUserE2eiCertificates.invoke(any()) } returns mapOf() coEvery { isOneToOneConversationCreated.invoke(any()) } returns true }