inline fun <reified 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, @Incubating useConstructor: UseConstructor? = null, @Incubating outerInstance: Any? = null): T
Creates a mock for T.
extraInterfaces - Specifies extra interfaces the mock should implement.
name - Specifies mock name. Naming mocks can be helpful for debugging - the name is used in all verification errors.
spiedInstance - Specifies the instance to spy on. Makes sense only for spies/partial mocks.
defaultAnswer - Specifies default answers to interactions.
serializable - Configures the mock to be serializable.
serializableMode - Configures the mock to be serializable with a specific serializable mode.
verboseLogging - Enables real-time logging of method invocations on this mock.
invocationListeners - Registers a listener for method invocations on this mock. The listener is notified every time a method on this mock is called.
stubOnly - A stub-only mock does not record method invocations, thus saving memory but disallowing verification of invocations.
useConstructor - Mockito attempts to use constructor when creating instance of the mock.
outerInstance - Makes it possible to mock non-static inner classes in conjunction with useConstructor.
inline fun <reified 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, @Incubating useConstructor: UseConstructor? = null, @Incubating outerInstance: Any? = null, stubbing: KStubbing<T>.(T) -> Unit): T
Creates a mock for T, allowing for immediate stubbing.
extraInterfaces - Specifies extra interfaces the mock should implement.
name - Specifies mock name. Naming mocks can be helpful for debugging - the name is used in all verification errors.
spiedInstance - Specifies the instance to spy on. Makes sense only for spies/partial mocks.
defaultAnswer - Specifies default answers to interactions.
serializable - Configures the mock to be serializable.
serializableMode - Configures the mock to be serializable with a specific serializable mode.
verboseLogging - Enables real-time logging of method invocations on this mock.
invocationListeners - Registers a listener for method invocations on this mock. The listener is notified every time a method on this mock is called.
stubOnly - A stub-only mock does not record method invocations, thus saving memory but disallowing verification of invocations.
useConstructor - Mockito attempts to use constructor when creating instance of the mock.
outerInstance - Makes it possible to mock non-static inner classes in conjunction with useConstructor.
inline fun <reified T : Any> mock(a: Answer<Any>): Tinline fun <reified T : Any> mock(s: String): Tinline fun <reified T : Any> mock(s: MockSettings): T