Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Mockito 4.11.0 -> 5.5.0 #43

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
7 changes: 4 additions & 3 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ object Versions {
const val ANDROID_GRADLE_PLUGIN = "7.4.2"
const val JUNIT = "4.13.2"
const val ROBOLECTRIC = "4.10.3"
kyrillosgait marked this conversation as resolved.
Show resolved Hide resolved
const val MOCKITO = "4.11.0"
const val MOCKITO_KOTLIN = "4.1.0"
const val MOCKITO = "5.5.0"
const val MOCKITO_INLINE = "5.2.0"
const val MOCKITO_KOTLIN = "5.1.0"
const val CORE_KTX = "1.6.0"
const val FRAGMENT_KTX = "1.2.4"
const val DETEKT_RUNTIME = "1.23.1"
Expand Down Expand Up @@ -38,7 +39,7 @@ object Libs {
const val CORE_KTX = "androidx.core:core-ktx:${Versions.CORE_KTX}"
const val KOTLIN_TESTS = "org.jetbrains.kotlin:kotlin-test:${Versions.KOTLIN}"
const val FRAGMENT_KTX = "androidx.fragment:fragment-ktx:${Versions.FRAGMENT_KTX}"
const val MOCKITO_INLINE = "org.mockito:mockito-inline:${Versions.MOCKITO}"
const val MOCKITO_INLINE = "org.mockito:mockito-inline:${Versions.MOCKITO_INLINE}"
const val LIFECYCLE = "androidx.lifecycle:lifecycle-common-java8:${Versions.LIFECYCLE}"
@Suppress("MaxLineLength")
const val VIEW_BINDING_DELEGATE = "com.github.kirich1409:viewbindingpropertydelegate-noreflection:${Versions.VIEW_BINDING_DELEGATE}"
Expand Down
3 changes: 3 additions & 0 deletions library/src/test/java/com/vinted/coper/CoperImplTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.Mockito.*
import org.mockito.internal.util.MockUtil
import org.mockito.kotlin.anyArray
import org.mockito.kotlin.anyOrNull
import org.mockito.kotlin.whenever
Expand Down Expand Up @@ -846,6 +847,8 @@ class CoperImplTest {

private suspend fun CoperImpl.mockGetFragmentWithStub() {
val coperFragment = getFragmentSafely()
if (MockUtil.isMock(coperFragment)) return

val spyCoperFragment = spy(coperFragment)
// This is needed because spy creates new instance and stubbing needs exact reference
coperFragment.requireActivity().supportFragmentManager.beginTransaction()
Expand Down