class KArgumentCaptor<out T> |
|
class KStubbing<out T> |
|
class VerifyScope<T> |
class MockitoKotlinException : RuntimeException |
fun after(millis: Long): VerificationAfterDelay |
|
fun <T : Any> any(): T
Matches any object, excluding nulls. |
|
fun <T> anyArray(): Array<T>
Matches any array of type T. |
|
fun <T : Any> anyOrNull(): T
Matches anything, including nulls. |
|
fun <T : Any> anyVararg(): T
Matches any vararg object, including nulls. |
|
fun <T : Any> argForWhich(predicate: T.() -> Boolean): T
Creates a custom argument matcher.
|
|
fun <T : Any> argThat(predicate: T.() -> Boolean): T
Creates a custom argument matcher.
|
|
fun <T : Any> argWhere(predicate: (T) -> Boolean): T
Creates a custom argument matcher.
|
|
fun <T : Any> argumentCaptor(): KArgumentCaptor<T> |
|
fun atLeast(numInvocations: Int): VerificationMode |
|
fun atLeastOnce(): VerificationMode |
|
fun atMost(maxNumberOfInvocations: Int): VerificationMode |
|
fun calls(wantedNumberOfInvocations: Int): VerificationMode |
|
fun <T : Any> capture(captor: ArgumentCaptor<T>): T |
|
fun <T : Any> check(predicate: (T) -> Unit): T
For usage with verification only. |
|
fun <T> clearInvocations(vararg mocks: T): Unit |
|
fun <T : Any> createInstance(): Tfun <T : Any> createInstance(kClass: KClass<T>): T |
|
fun description(description: String): VerificationMode |
|
fun <T> doAnswer(answer: (InvocationOnMock) -> T?): Stubber |
|
fun doCallRealMethod(): Stubber |
|
fun doNothing(): Stubber |
|
fun doReturn(value: Any?): Stubberfun doReturn(toBeReturned: Any?, vararg toBeReturnedNext: Any?): Stubber |
|
fun doThrow(toBeThrown: KClass<out Throwable>): Stubberfun doThrow(vararg toBeThrown: Throwable): Stubber |
|
fun <T> eq(value: T): T |
|
fun <T> given(methodCall: T): BDDMyOngoingStubbing<T>fun <T> given(methodCall: () -> T): BDDMyOngoingStubbing<T> |
|
fun ignoreStubs(vararg mocks: Any): Array<out Any> |
|
fun inOrder(vararg mocks: Any): InOrderfun inOrder(vararg mocks: Any, evaluation: InOrder.() -> Unit): Unit |
|
fun <T : Any> isA(): T |
|
fun <T : Any> isNotNull(): T? |
|
fun <T : Any> isNull(): T? |
|
fun <T : Any> mock(extraInterfaces: Array<KClass<out Any>>? = null, name: String? = null, spiedInstance: Any? = null, defaultAnswer: Answer<Any>? = null, serializable: Boolean = false, serializableMode: SerializableMode? = null, verboseLogging: Boolean = false, invocationListeners: Array<InvocationListener>? = null, stubOnly: Boolean = false, useConstructor: Boolean = false, outerInstance: Any? = null): Tfun <T : Any> mock(extraInterfaces: Array<KClass<out Any>>? = null, name: String? = null, spiedInstance: Any? = null, defaultAnswer: Answer<Any>? = null, serializable: Boolean = false, serializableMode: SerializableMode? = null, verboseLogging: Boolean = false, invocationListeners: Array<InvocationListener>? = null, stubOnly: Boolean = false, useConstructor: Boolean = false, outerInstance: Any? = null, stubbing: KStubbing<T>.(T) -> Unit): Tfun <T : Any> fun <T : Any> fun <T : Any> |
|
fun mockingDetails(toInspect: Any): MockingDetails |
|
fun never(): VerificationMode |
|
fun <T : Any> notNull(): T? |
|
fun <T : Any> nullableArgumentCaptor(): KArgumentCaptor<T?> |
|
fun only(): VerificationMode |
|
fun <T> refEq(value: T, vararg excludeFields: String): T? |
|
fun <T> reset(vararg mocks: T): Unit |
|
fun <T> same(value: T): T |
|
fun <T : Any> spy(): Tfun <T> spy(value: T): T |
|
fun <T : Any> T.stub(stubbing: KStubbing<T>.(T) -> Unit): T |
|
fun <T> then(mock: T): Then<T> |
|
fun timeout(millis: Long): VerificationWithTimeout |
|
fun times(numInvocations: Int): VerificationMode |
|
fun validateMockitoUsage(): Unit |
|
fun <T> verify(mock: T): Tfun <T> verify(mock: T, mode: VerificationMode): Tfun <T> verify(mock: T, block: VerifyScope<T>.() -> Unit): Unit
Verify multiple calls on mock Supports an easier to read style of |
|
fun <T> verifyNoMoreInteractions(vararg mocks: T): Unit |
|
fun verifyZeroInteractions(vararg mocks: Any): Unit |
|
fun <T> whenever(methodCall: T): OngoingStubbing<T> |
|
fun withSettings(extraInterfaces: Array<KClass<out Any>>? = null, name: String? = null, spiedInstance: Any? = null, defaultAnswer: Answer<Any>? = null, serializable: Boolean = false, serializableMode: SerializableMode? = null, verboseLogging: Boolean = false, invocationListeners: Array<InvocationListener>? = null, stubOnly: Boolean = false, useConstructor: Boolean = false, outerInstance: Any? = null): MockSettings |