T
- type of mock object to handlepublic class MockHandlerImpl<T> extends Object implements MockHandler<T>
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.
|
Object |
handle(Invocation invocation)
Takes an invocation object and handles it.
|
public MockHandlerImpl(MockCreationSettings<T> mockSettings)
public Object handle(Invocation invocation) throws 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 handleThrowable
- 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>
Copyright © 2019. All rights reserved.