From 400baca2c69e3affe0d90c1fe8a80a5631f13331 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Jan 2025 11:38:55 +0000 Subject: [PATCH] chore(deps): [WPB-9777] bump mockk from 1.13.10 to 1.13.16 (#3751) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yamil Medina Co-authored-by: Oussama Hassine --- .../MigrateServerConfigUseCaseTest.kt | 3 +-- .../ConnectionActionButtonViewModelTest.kt | 9 ++++----- .../forgot/ForgotLockScreenViewModelTest.kt | 5 ++--- .../SecurityClassificationViewModelTest.kt | 9 ++++----- .../account/MyAccountViewModelTest.kt | 8 +++----- .../handle/ChangeHandleViewModelTest.kt | 5 ++--- .../LegalHoldRequestedViewModelTest.kt | 7 +++---- .../devices/DeviceDetailsViewModelTest.kt | 19 +++++++++---------- .../image/AvatarPickerViewModelTest.kt | 5 +++-- .../OtherUserProfileScreenViewModelTest.kt | 5 ++--- gradle/libs.versions.toml | 2 +- 11 files changed, 34 insertions(+), 43 deletions(-) diff --git a/app/src/test/kotlin/com/wire/android/migration/MigrateServerConfigUseCaseTest.kt b/app/src/test/kotlin/com/wire/android/migration/MigrateServerConfigUseCaseTest.kt index 5b12c4da989..8010161cfe5 100644 --- a/app/src/test/kotlin/com/wire/android/migration/MigrateServerConfigUseCaseTest.kt +++ b/app/src/test/kotlin/com/wire/android/migration/MigrateServerConfigUseCaseTest.kt @@ -34,7 +34,6 @@ import com.wire.kalium.logic.feature.server.StoreServerConfigResult import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.isLeft import com.wire.kalium.logic.functional.isRight -import io.mockk.Called import io.mockk.MockKAnnotations import io.mockk.coEvery import io.mockk.coVerify @@ -99,7 +98,7 @@ class MigrateServerConfigUseCaseTest { .withScalaServerConfig(ScalaServerConfig.NoData) .arrange() val result = useCase() - coVerify { arrangement.globalKaliumScope.storeServerConfig(any(), any()) wasNot Called } + coVerify(exactly = 0) { arrangement.globalKaliumScope.storeServerConfig(any(), any()) } assert(result.isLeft()) assertEquals(StorageFailure.DataNotFound, (result as Either.Left).value) } diff --git a/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt index 5da2f1ff9ad..0c90451a3f5 100644 --- a/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/connection/ConnectionActionButtonViewModelTest.kt @@ -44,7 +44,6 @@ import com.wire.kalium.logic.feature.connection.UnblockUserUseCase import com.wire.kalium.logic.feature.conversation.CreateConversationResult import com.wire.kalium.logic.feature.conversation.GetOrCreateOneToOneConversationUseCase import com.wire.kalium.logic.feature.user.ObserveSelfUserUseCase -import io.mockk.Called import io.mockk.MockKAnnotations import io.mockk.coEvery import io.mockk.coVerify @@ -273,7 +272,7 @@ class ConnectionActionButtonViewModelTest { arrangement.getOrCreateOneToOneConversation(TestUser.USER_ID) } verify { arrangement.onOpenConversation(any()) } - verify { arrangement.onMissingKeyPackages wasNot Called } + verify(exactly = 0) { arrangement.onMissingKeyPackages.invoke() } assertEquals(false, viewModel.actionableState().isPerformingAction) } @@ -292,8 +291,8 @@ class ConnectionActionButtonViewModelTest { coVerify { arrangement.getOrCreateOneToOneConversation(TestUser.USER_ID) } - verify { arrangement.onOpenConversation wasNot Called } - verify { arrangement.onMissingKeyPackages wasNot Called } + verify(exactly = 0) { arrangement.onOpenConversation.invoke(any()) } + verify(exactly = 0) { arrangement.onMissingKeyPackages() } assertEquals(false, viewModel.actionableState().isPerformingAction) } @@ -312,7 +311,7 @@ class ConnectionActionButtonViewModelTest { coVerify { arrangement.getOrCreateOneToOneConversation(TestUser.USER_ID) } - verify { arrangement.onOpenConversation wasNot Called } + verify(exactly = 0) { arrangement.onOpenConversation.invoke(any()) } verify { arrangement.onMissingKeyPackages() } assertEquals(false, viewModel.actionableState().isPerformingAction) } diff --git a/app/src/test/kotlin/com/wire/android/ui/home/appLock/forgot/ForgotLockScreenViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/home/appLock/forgot/ForgotLockScreenViewModelTest.kt index 7bdab55d6f5..83e2d761174 100644 --- a/app/src/test/kotlin/com/wire/android/ui/home/appLock/forgot/ForgotLockScreenViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/home/appLock/forgot/ForgotLockScreenViewModelTest.kt @@ -48,7 +48,6 @@ import com.wire.kalium.logic.feature.session.GetAllSessionsResult import com.wire.kalium.logic.feature.session.GetSessionsUseCase import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import com.wire.kalium.logic.feature.user.IsPasswordRequiredUseCase -import io.mockk.Called import io.mockk.MockKAnnotations import io.mockk.coEvery import io.mockk.coVerify @@ -77,7 +76,7 @@ class ForgotLockScreenViewModelTest { val (result, resultPassword) = viewModel.validatePasswordIfNeeded("password") assert(result is ForgotLockScreenViewModel.Result.Success) assertEquals("", resultPassword) - verify { arrangement.validatePasswordUseCase(any()) wasNot Called } + verify(exactly = 0) { arrangement.validatePasswordUseCase(any()) } } @Test fun `given password required and valid, when validating password, then return Success with given password`() = @@ -118,7 +117,7 @@ class ForgotLockScreenViewModelTest { .arrange() val (result, _) = viewModel.validatePasswordIfNeeded("password") assert(result is ForgotLockScreenViewModel.Result.Failure) - verify { arrangement.validatePasswordUseCase(any()) wasNot Called } + verify(exactly = 0) { arrangement.validatePasswordUseCase(any()) } } // current client deletion diff --git a/app/src/test/kotlin/com/wire/android/ui/home/conversations/banner/SecurityClassificationViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/home/conversations/banner/SecurityClassificationViewModelTest.kt index a7708e603f4..b0121a8b130 100644 --- a/app/src/test/kotlin/com/wire/android/ui/home/conversations/banner/SecurityClassificationViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/home/conversations/banner/SecurityClassificationViewModelTest.kt @@ -30,7 +30,6 @@ import com.wire.kalium.logic.feature.conversation.ObserveOtherUserSecurityClassi import com.wire.kalium.logic.feature.conversation.ObserveSecurityClassificationLabelUseCase import com.wire.kalium.logic.feature.conversation.SecurityClassificationType import io.mockk.MockKAnnotations -import io.mockk.called import io.mockk.coEvery import io.mockk.coVerify import io.mockk.every @@ -64,8 +63,8 @@ class SecurityClassificationViewModelTest { // Then assertEquals(SecurityClassificationType.CLASSIFIED, viewModel.state()) - coVerify { - arrangement.getOtherUserSecurityClassificationLabel(any()) wasNot called + coVerify(exactly = 0) { + arrangement.getOtherUserSecurityClassificationLabel(any()) } } @@ -85,8 +84,8 @@ class SecurityClassificationViewModelTest { // Then assertEquals(SecurityClassificationType.CLASSIFIED, viewModel.state()) - coVerify { - arrangement.observeSecurityClassificationLabel(any()) wasNot called + coVerify(exactly = 0) { + arrangement.observeSecurityClassificationLabel(any()) } } diff --git a/app/src/test/kotlin/com/wire/android/ui/home/settings/account/MyAccountViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/home/settings/account/MyAccountViewModelTest.kt index a23b3aac9cb..1623e804868 100644 --- a/app/src/test/kotlin/com/wire/android/ui/home/settings/account/MyAccountViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/home/settings/account/MyAccountViewModelTest.kt @@ -27,22 +27,20 @@ import com.wire.android.util.newServerConfig import com.wire.kalium.logic.StorageFailure import com.wire.kalium.logic.data.id.TeamId import com.wire.kalium.logic.feature.team.GetUpdatedSelfTeamUseCase -import com.wire.kalium.logic.feature.user.ObserveSelfUserUseCase import com.wire.kalium.logic.feature.user.IsE2EIEnabledUseCase import com.wire.kalium.logic.feature.user.IsPasswordRequiredUseCase import com.wire.kalium.logic.feature.user.IsPasswordRequiredUseCase.Result.Success import com.wire.kalium.logic.feature.user.IsReadOnlyAccountUseCase import com.wire.kalium.logic.feature.user.IsSelfATeamMemberUseCase +import com.wire.kalium.logic.feature.user.ObserveSelfUserUseCase import com.wire.kalium.logic.feature.user.SelfServerConfigUseCase import com.wire.kalium.logic.functional.Either -import io.mockk.Called import io.mockk.MockKAnnotations import io.mockk.coEvery import io.mockk.coVerify import io.mockk.every import io.mockk.impl.annotations.MockK import io.mockk.mockkObject -import io.mockk.verify import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.flow.flowOf import kotlinx.coroutines.test.runTest @@ -118,8 +116,8 @@ class MyAccountViewModelTest { .withE2EIEnabledResult(false) .arrange() - verify { - arrangement.selfServerConfigUseCase wasNot Called + coVerify(exactly = 0) { + arrangement.selfServerConfigUseCase.invoke() } } diff --git a/app/src/test/kotlin/com/wire/android/ui/home/settings/account/handle/ChangeHandleViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/home/settings/account/handle/ChangeHandleViewModelTest.kt index 8fb768a3a82..b1859348640 100644 --- a/app/src/test/kotlin/com/wire/android/ui/home/settings/account/handle/ChangeHandleViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/home/settings/account/handle/ChangeHandleViewModelTest.kt @@ -28,7 +28,6 @@ import com.wire.kalium.logic.feature.auth.ValidateUserHandleUseCase import com.wire.kalium.logic.feature.user.GetSelfUserUseCase import com.wire.kalium.logic.feature.user.SetUserHandleResult import com.wire.kalium.logic.feature.user.SetUserHandleUseCase -import io.mockk.Called import io.mockk.MockKAnnotations import io.mockk.coEvery import io.mockk.coVerify @@ -84,8 +83,8 @@ class ChangeHandleViewModelTest { viewModel.onSaveClicked(arrangement.onSuccess) assertEquals(viewModel.state.error, HandleUpdateErrorState.TextFieldError.UsernameInvalidError) - coVerify { - arrangement.validateHandle("handle") wasNot Called + coVerify(exactly = 1) { + arrangement.validateHandle("handle") } } diff --git a/app/src/test/kotlin/com/wire/android/ui/legalhold/dialog/requested/LegalHoldRequestedViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/legalhold/dialog/requested/LegalHoldRequestedViewModelTest.kt index 5fac285f255..a266f40a0d4 100644 --- a/app/src/test/kotlin/com/wire/android/ui/legalhold/dialog/requested/LegalHoldRequestedViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/legalhold/dialog/requested/LegalHoldRequestedViewModelTest.kt @@ -32,7 +32,6 @@ import com.wire.kalium.logic.feature.legalhold.ApproveLegalHoldRequestUseCase import com.wire.kalium.logic.feature.legalhold.ObserveLegalHoldRequestUseCase import com.wire.kalium.logic.feature.session.CurrentSessionResult import com.wire.kalium.logic.feature.user.IsPasswordRequiredUseCase -import io.mockk.Called import io.mockk.MockKAnnotations import io.mockk.coEvery import io.mockk.coVerify @@ -248,7 +247,7 @@ class LegalHoldRequestedViewModelTest { .arrange() advanceUntilIdle() viewModel.acceptClicked() - verify { arrangement.validatePassword(any()) wasNot Called } + verify(exactly = 0) { arrangement.validatePassword(any()) } coVerify { arrangement.userSessionScope.approveLegalHoldRequest(matchNullable { it == null }) } } @@ -263,7 +262,7 @@ class LegalHoldRequestedViewModelTest { advanceUntilIdle() viewModel.acceptClicked() verify { arrangement.validatePassword(password) } - coVerify { arrangement.userSessionScope.approveLegalHoldRequest(matchNullable { it.isNullOrEmpty() }) wasNot Called } + coVerify(exactly = 0) { arrangement.userSessionScope.approveLegalHoldRequest(matchNullable { it.isNullOrEmpty() }) } } @Test @@ -276,7 +275,7 @@ class LegalHoldRequestedViewModelTest { viewModel.passwordTextState.setTextAndPlaceCursorAtEnd(password) advanceUntilIdle() viewModel.acceptClicked() - coVerify { arrangement.userSessionScope.approveLegalHoldRequest(password) wasNot Called } + coVerify(exactly = 0) { arrangement.userSessionScope.approveLegalHoldRequest(password) } } @Test diff --git a/app/src/test/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModelTest.kt index 5e0ea113b3a..f664129c432 100644 --- a/app/src/test/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/settings/devices/DeviceDetailsViewModelTest.kt @@ -55,7 +55,6 @@ import com.wire.kalium.logic.feature.user.IsPasswordRequiredUseCase import com.wire.kalium.logic.feature.user.ObserveUserInfoUseCase import com.wire.kalium.logic.functional.Either import com.wire.kalium.logic.functional.right -import io.mockk.Called import io.mockk.MockKAnnotations import io.mockk.coEvery import io.mockk.coVerify @@ -132,10 +131,10 @@ class DeviceDetailsViewModelTest { viewModel.removeDevice(arrangement.onSuccess) - coVerify { - arrangement.deleteClientUseCase(any()) wasNot Called + coVerify(exactly = 0) { + arrangement.deleteClientUseCase(any()) } - verify { arrangement.onSuccess wasNot Called } + verify(exactly = 0) { arrangement.onSuccess.invoke() } assertIs(viewModel.state.removeDeviceDialogState) assertIs(viewModel.state.error) } @@ -151,10 +150,10 @@ class DeviceDetailsViewModelTest { viewModel.onDialogDismissed() - coVerify { - arrangement.deleteClientUseCase(any()) wasNot Called + coVerify(exactly = 0) { + arrangement.deleteClientUseCase(any()) } - verify { arrangement.onSuccess wasNot Called } + verify(exactly = 0) { arrangement.onSuccess.invoke() } assertIs(viewModel.state.removeDeviceDialogState) assertIs(viewModel.state.error) } @@ -172,10 +171,10 @@ class DeviceDetailsViewModelTest { viewModel.removeDevice(arrangement.onSuccess) viewModel.clearDeleteClientError() - coVerify { - arrangement.deleteClientUseCase.invoke(any()) wasNot Called + coVerify(exactly = 0) { + arrangement.deleteClientUseCase.invoke(any()) } - verify { arrangement.onSuccess wasNot Called } + verify(exactly = 0) { arrangement.onSuccess.invoke() } assertIs(viewModel.state.removeDeviceDialogState) assertIs(viewModel.state.error) } diff --git a/app/src/test/kotlin/com/wire/android/ui/userprofile/image/AvatarPickerViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/userprofile/image/AvatarPickerViewModelTest.kt index c5fc365e5ae..31e66ccb26d 100644 --- a/app/src/test/kotlin/com/wire/android/ui/userprofile/image/AvatarPickerViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/userprofile/image/AvatarPickerViewModelTest.kt @@ -38,7 +38,6 @@ import com.wire.kalium.logic.feature.asset.GetAvatarAssetUseCase import com.wire.kalium.logic.feature.asset.PublicAssetResult import com.wire.kalium.logic.feature.user.UploadAvatarResult import com.wire.kalium.logic.feature.user.UploadUserAvatarUseCase -import io.mockk.Called import io.mockk.MockKAnnotations import io.mockk.coEvery import io.mockk.coVerify @@ -104,7 +103,9 @@ class AvatarPickerViewModelTest { with(arrangement) { coVerify { uploadUserAvatarUseCase(any(), any()) - avatarImageManager.getWritableAvatarUri(any()) wasNot Called + } + coVerify(exactly = 1) { + avatarImageManager.getWritableAvatarUri(any()) } verify(exactly = 0) { onSuccess(any()) } } diff --git a/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModelTest.kt b/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModelTest.kt index eab68d1dfe0..83ff949e572 100644 --- a/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModelTest.kt +++ b/app/src/test/kotlin/com/wire/android/ui/userprofile/other/OtherUserProfileScreenViewModelTest.kt @@ -41,7 +41,6 @@ import com.wire.kalium.logic.feature.connection.BlockUserResult import com.wire.kalium.logic.feature.conversation.GetOneToOneConversationUseCase import com.wire.kalium.logic.feature.conversation.UpdateConversationMemberRoleResult import com.wire.kalium.logic.feature.user.GetUserInfoResult -import io.mockk.Called import io.mockk.coVerify import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.test.runTest @@ -87,8 +86,8 @@ class OtherUserProfileScreenViewModelTest { val groupState = viewModel.state.groupState // then - coVerify { - arrangement.observeConversationRoleForUserUseCase(any(), any()) wasNot Called + coVerify(exactly = 0) { + arrangement.observeConversationRoleForUserUseCase(any(), any()) } assertEquals(groupState, null) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ea6a2d4a205..06e5608c648 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -103,7 +103,7 @@ androidx-text-archCore = "2.2.0" junit4 = "4.13.2" junit5 = "5.11.0" kluent = "1.73" -mockk = "1.13.10" +mockk = "1.13.16" okio = "3.9.0" turbine = "1.2.0" robolectric = "4.12.2"