Skip to content

Commit

Permalink
Upgrade Mockito 4.11.0 -> 5.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kyrillosgait committed Sep 29, 2023
1 parent dd7e4c5 commit 75fa8bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ object Versions {
const val ANDROID_GRADLE_PLUGIN = "7.4.2"
const val JUNIT = "4.13.2"
const val ROBOLECTRIC = "4.10.3"
const val MOCKITO = "4.11.0"
const val MOCKITO = "5.5.0"
const val MOCKITO_INLINE = "5.2.0"
const val MOCKITO_KOTLIN = "4.1.0"
const val CORE_KTX = "1.6.0"
const val FRAGMENT_KTX = "1.2.4"
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

0 comments on commit 75fa8bb

Please sign in to comment.