public interface MockHandler<T> extends Serializable
MockMaker. Handler can be used to programmatically simulate invocations on the mock object.
Mockito will provide you with the implementation of this interface via
MockMaker.resetMock(Object, MockHandler, MockCreationSettings).
You can provide your own implementation of MockHandler but make sure that the right instance is returned by
|Modifier and Type||Method and Description|
Returns the object that holds all invocations on the mock object, including stubbings with declared answers.
Read-only settings the mock object was created with.
Takes an invocation object and handles it.
Object handle(Invocation invocation) throws Throwable
The default implementation provided by Mockito handles invocations by recording method calls on mocks for further verification, captures the stubbing information when mock is stubbed, returns the stubbed values for invocations that have been stubbed, and much more.
invocation- The invocation to handle
@Incubating MockCreationSettings<T> getMockSettings()
@Incubating InvocationContainer getInvocationContainer()
Please do not provide your own implementation of
InvocationContainer interface at this point.
If you have a use case that requires your own implementation of
please reach out to us. You can open a ticket in our issue tracker to start a discussion.