T
- type of mock object to handlepublic class MockHandlerImpl<T> extends java.lang.Object implements MockHandler<T>
Modifier and Type | Field and Description |
---|---|
(package private) InvocationContainerImpl |
invocationContainer |
(package private) MatchersBinder |
matchersBinder |
private MockCreationSettings<T> |
mockSettings |
private static long |
serialVersionUID |
Constructor and Description |
---|
MockHandlerImpl(MockCreationSettings<T> mockSettings) |
Modifier and Type | Method and Description |
---|---|
InvocationContainer |
getInvocationContainer()
Returns the object that holds all invocations on the mock object,
including stubbings with declared answers.
|
MockCreationSettings<T> |
getMockSettings()
Read-only settings the mock object was created with.
|
java.lang.Object |
handle(Invocation invocation)
Takes an invocation object and handles it.
|
private static final long serialVersionUID
InvocationContainerImpl invocationContainer
MatchersBinder matchersBinder
private final MockCreationSettings<T> mockSettings
public MockHandlerImpl(MockCreationSettings<T> mockSettings)
public java.lang.Object handle(Invocation invocation) throws java.lang.Throwable
MockHandler
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.
handle
in interface MockHandler<T>
invocation
- The invocation to handlejava.lang.Throwable
- Throwablepublic MockCreationSettings<T> getMockSettings()
MockHandler
Mockito.mock(Class, MockSettings)
getMockSettings
in interface MockHandler<T>
public InvocationContainer getInvocationContainer()
MockHandler
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 InvocationContainer
please reach out to us. You can open a ticket in our issue tracker to start a discussion.
getInvocationContainer
in interface MockHandler<T>