mockito-kotlin / com.nhaarman.mockitokotlin2 / argThat

argThat

inline fun <reified T : Any> argThat(noinline predicate: T.() -> Boolean): T

Creates a custom argument matcher. null values will never evaluate to true.

Parameters

predicate - An extension function on T that returns true when a T matches the predicate.

inline fun <reified T : Any> argThat(matcher: ArgumentMatcher<T>): T

Registers a custom ArgumentMatcher. The original Mockito function registers the matcher and returns null, here the required type is returned.

Parameters

matcher - The ArgumentMatcher on T to be registered.