class InvocationNotifierHandler<T> extends java.lang.Object implements MockHandler<T>
Modifier and Type | Field and Description |
---|---|
private java.util.List<InvocationListener> |
invocationListeners |
private MockHandler<T> |
mockHandler |
Constructor and Description |
---|
InvocationNotifierHandler(MockHandler<T> mockHandler,
MockCreationSettings<T> settings) |
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 void |
notifyMethodCall(Invocation invocation,
java.lang.Object returnValue) |
private void |
notifyMethodCallException(Invocation invocation,
java.lang.Throwable exception) |
private final java.util.List<InvocationListener> invocationListeners
private final MockHandler<T> mockHandler
public InvocationNotifierHandler(MockHandler<T> mockHandler, MockCreationSettings<T> settings)
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
- Throwableprivate void notifyMethodCall(Invocation invocation, java.lang.Object returnValue)
private void notifyMethodCallException(Invocation invocation, java.lang.Throwable exception)
public 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>