File tree 5 files changed +14
-19
lines changed
src/main/kotlin/org/mockito/kotlin
5 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ dependencies {
25
25
compileOnly " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
26
26
compileOnly ' org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0'
27
27
28
- compile " org.mockito:mockito-core:3.12.4 "
28
+ compile " org.mockito:mockito-core:4.0.0 "
29
29
30
30
testCompile ' junit:junit:4.12'
31
31
testCompile ' com.nhaarman:expect.kt:1.0.0'
Original file line number Diff line number Diff line change @@ -90,19 +90,6 @@ fun verifyNoInteractions(vararg mocks: Any) {
90
90
Mockito .verifyNoInteractions(* mocks)
91
91
}
92
92
93
- /* *
94
- * @deprecated
95
- *
96
- * Please migrate your code to [verifyNoInteractions].
97
- */
98
- @Deprecated(
99
- " Use verifyNoInteractions() instead." ,
100
- ReplaceWith (" verifyNoInteractions(vararg mocks: Any)" )
101
- )
102
- fun verifyZeroInteractions (vararg mocks : Any ) {
103
- Mockito .verifyZeroInteractions(* mocks)
104
- }
105
-
106
93
/* *
107
94
* Allows verifying exact number of invocations.
108
95
*
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ dependencies {
22
22
compile files(" ${ rootProject.projectDir} /mockito-kotlin/build/libs/mockito-kotlin-${ version} .jar" )
23
23
24
24
compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
25
- compile " org.mockito:mockito-core:2.23 .0"
25
+ compile " org.mockito:mockito-core:4.0 .0"
26
26
27
27
testCompile " junit:junit:4.12"
28
28
testCompile " com.nhaarman:expect.kt:1.0.0"
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import org.mockito.kotlin.whenever
12
12
import org.junit.Test
13
13
import org.mockito.Mockito
14
14
import org.mockito.exceptions.verification.WantedButNotInvoked
15
+ import org.mockito.invocation.DescribedInvocation
16
+ import org.mockito.kotlin.argumentCaptor
15
17
import org.mockito.listeners.InvocationListener
16
18
import org.mockito.mock.SerializableMode.BASIC
17
19
import java.io.PrintStream
@@ -182,7 +184,10 @@ class MockingTest : TestBase() {
182
184
fail(" Expected an exception" )
183
185
} catch (e: WantedButNotInvoked ) {
184
186
/* Then */
185
- verify(out ).println (" methods.stringResult();" )
187
+ argumentCaptor<DescribedInvocation >().apply {
188
+ verify(out ).println (capture())
189
+ expect(lastValue.toString()).toBe(" methods.stringResult();" )
190
+ }
186
191
}
187
192
}
188
193
@@ -314,7 +319,10 @@ class MockingTest : TestBase() {
314
319
fail(" Expected an exception" )
315
320
} catch (e: WantedButNotInvoked ) {
316
321
/* Then */
317
- verify(out ).println (" methods.stringResult();" )
322
+ argumentCaptor<DescribedInvocation >().apply {
323
+ verify(out ).println (capture())
324
+ expect(lastValue.toString()).toBe(" methods.stringResult();" )
325
+ }
318
326
}
319
327
}
320
328
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import org.mockito.kotlin.any
4
4
import org.mockito.kotlin.mock
5
5
import org.mockito.kotlin.verify
6
6
import org.junit.Test
7
- import org.mockito.exceptions.verification.TooLittleActualInvocations
7
+ import org.mockito.exceptions.verification.TooFewActualInvocations
8
8
import org.mockito.exceptions.verification.junit.ArgumentsAreDifferent
9
9
10
10
class VerifyTest : TestBase () {
@@ -30,7 +30,7 @@ class VerifyTest : TestBase() {
30
30
}
31
31
}
32
32
33
- @Test(expected = TooLittleActualInvocations ::class )
33
+ @Test(expected = TooFewActualInvocations ::class )
34
34
fun verifyFailsWithWrongCount () {
35
35
val iface = mock<TestInterface >()
36
36
You can’t perform that action at this time.
0 commit comments