File tree Expand file tree Collapse file tree 3 files changed +18
-3
lines changed
main/kotlin/com/nhaarman/mockito_kotlin Expand file tree Collapse file tree 3 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ repositories {
26
26
dependencies {
27
27
compile " org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version "
28
28
compile " org.jetbrains.kotlin:kotlin-reflect:$kotlin_version "
29
- compile " org.mockito:mockito-core:2.2.17 "
29
+ compile " org.mockito:mockito-core:2.2.22 "
30
30
31
31
/* Tests */
32
32
testCompile " junit:junit:4.12"
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ fun ignoreStubs(vararg mocks: Any): Array<out Any> = Mockito.ignoreStubs(*mocks)
78
78
fun inOrder (vararg mocks : Any ): InOrder = Mockito .inOrder(* mocks)!!
79
79
fun inOrder (vararg mocks : Any , evaluation : InOrder .() -> Unit ) = Mockito .inOrder(* mocks).evaluation()
80
80
81
- inline fun <reified T : Any > isA (): T ? = Mockito .isA(T ::class .java)
81
+ inline fun <reified T : Any > isA (): T = Mockito .isA(T ::class .java) ? : createInstance< T >( )
82
82
fun <T : Any > isNotNull (): T ? = Mockito .isNotNull()
83
83
fun <T : Any > isNull (): T ? = Mockito .isNull()
84
84
Original file line number Diff line number Diff line change @@ -492,4 +492,19 @@ class MockitoTest : TestBase() {
492
492
/* Then */
493
493
expect(mock.genericMethod()).toBe(2 )
494
494
}
495
- }
495
+
496
+ @Test
497
+ fun isA_withNonNullableString () {
498
+ mock<Methods >().apply {
499
+ string(" " )
500
+ verify(this ).string(isA<String >())
501
+ }
502
+ }
503
+ @Test
504
+ fun isA_withNullableString () {
505
+ mock<Methods >().apply {
506
+ nullableString(" " )
507
+ verify(this ).nullableString(isA<String >())
508
+ }
509
+ }
510
+ }
You can’t perform that action at this time.
0 commit comments