@@ -27,36 +27,36 @@ package org.mockito.kotlin
2727
2828import org.mockito.kotlin.internal.createInstance
2929import org.mockito.ArgumentMatcher
30- import org.mockito.Mockito
30+ import org.mockito.ArgumentMatchers
3131
3232/* * Object argument that is equal to the given value. */
3333fun <T > eq (value : T ): T {
34- return Mockito .eq(value) ? : value
34+ return ArgumentMatchers .eq(value) ? : value
3535}
3636
3737/* * Object argument that is the same as the given value. */
3838fun <T > same (value : T ): T {
39- return Mockito .same(value) ? : value
39+ return ArgumentMatchers .same(value) ? : value
4040}
4141
4242/* * Matches any object, excluding nulls. */
4343inline fun <reified T : Any > any (): T {
44- return Mockito .any(T ::class .java) ? : createInstance()
44+ return ArgumentMatchers .any(T ::class .java) ? : createInstance()
4545}
4646
4747/* * Matches anything, including nulls. */
4848inline fun <reified T : Any > anyOrNull (): T {
49- return Mockito .any<T >() ? : createInstance()
49+ return ArgumentMatchers .any<T >() ? : createInstance()
5050}
5151
5252/* * Matches any vararg object, including nulls. */
5353inline fun <reified T : Any > anyVararg (): T {
54- return Mockito .any<T >() ? : createInstance()
54+ return ArgumentMatchers .any<T >() ? : createInstance()
5555}
5656
5757/* * Matches any array of type T. */
5858inline fun <reified T : Any ? > anyArray (): Array <T > {
59- return Mockito .any(Array <T >::class .java) ? : arrayOf()
59+ return ArgumentMatchers .any(Array <T >::class .java) ? : arrayOf()
6060}
6161
6262/* *
@@ -66,7 +66,7 @@ inline fun <reified T : Any?> anyArray(): Array<T> {
6666 * @param predicate An extension function on [T] that returns `true` when a [T] matches the predicate.
6767 */
6868inline fun <reified T : Any > argThat (noinline predicate : T .() -> Boolean ): T {
69- return Mockito .argThat { arg: T ? -> arg?.predicate() ? : false } ? : createInstance(
69+ return ArgumentMatchers .argThat { arg: T ? -> arg?.predicate() ? : false } ? : createInstance(
7070 T ::class
7171 )
7272}
@@ -78,7 +78,7 @@ inline fun <reified T : Any> argThat(noinline predicate: T.() -> Boolean): T {
7878 * @param matcher The ArgumentMatcher on [T] to be registered.
7979 */
8080inline fun <reified T : Any > argThat (matcher : ArgumentMatcher <T >): T {
81- return Mockito .argThat(matcher) ? : createInstance()
81+ return ArgumentMatchers .argThat(matcher) ? : createInstance()
8282}
8383
8484/* *
@@ -107,33 +107,33 @@ inline fun <reified T : Any> argWhere(noinline predicate: (T) -> Boolean): T {
107107 * Argument that implements the given class.
108108 */
109109inline fun <reified T : Any > isA (): T {
110- return Mockito .isA(T ::class .java) ? : createInstance()
110+ return ArgumentMatchers .isA(T ::class .java) ? : createInstance()
111111}
112112
113113/* *
114114 * `null` argument.
115115 */
116- fun <T : Any > isNull (): T ? = Mockito .isNull()
116+ fun <T : Any > isNull (): T ? = ArgumentMatchers .isNull()
117117
118118/* *
119119 * Not `null` argument.
120120 */
121121fun <T : Any > isNotNull (): T ? {
122- return Mockito .isNotNull()
122+ return ArgumentMatchers .isNotNull()
123123}
124124
125125/* *
126126 * Not `null` argument.
127127 */
128128fun <T : Any > notNull (): T ? {
129- return Mockito .notNull()
129+ return ArgumentMatchers .notNull()
130130}
131131
132132/* *
133133 * Object argument that is reflection-equal to the given value with support for excluding
134134 * selected fields from a class.
135135 */
136136inline fun <reified T : Any > refEq (value : T , vararg excludeFields : String ): T {
137- return Mockito .refEq<T >(value, * excludeFields) ? : createInstance()
137+ return ArgumentMatchers .refEq<T >(value, * excludeFields) ? : createInstance()
138138}
139139
0 commit comments