Package | Description |
---|---|
org.mockito |
Mockito is a mock library for java - see
Mockito class for usage. |
org.mockito.plugins |
Mockito plugins allow customization of behavior.
|
Modifier and Type | Method and Description |
---|---|
MockHandler |
MockingDetails.getMockHandler()
Returns the
MockHandler associated with this mock object. |
Modifier and Type | Method and Description |
---|---|
MockHandler |
MockMaker.getHandler(Object mock)
Returns the handler for the
mock . |
Modifier and Type | Method and Description |
---|---|
<T> T |
MockMaker.createMock(MockCreationSettings<T> settings,
MockHandler handler)
If you want to provide your own implementation of
MockMaker this method should:
Create a proxy object that implements settings.typeToMock and potentially also settings.extraInterfaces .
You may use the information from settings to create/configure your proxy object.
Your proxy object should carry the handler with it. |
default <T> Optional<T> |
MockMaker.createSpy(MockCreationSettings<T> settings,
MockHandler handler,
T instance)
By implementing this method, a mock maker can optionally support the creation of spies where all fields
are set within a constructor.
|
default <T> MockMaker.StaticMockControl<T> |
MockMaker.createStaticMock(Class<T> type,
MockCreationSettings<T> settings,
MockHandler handler)
If you want to provide your own implementation of
MockMaker this method should:
Alter the supplied class to only change its behavior in the current thread.
Only alters the static method's behavior after being enabled.
Stops the altered behavior when disabled.
|
void |
MockMaker.resetMock(Object mock,
MockHandler newHandler,
MockCreationSettings settings)
Replaces the existing handler on
mock with newHandler . |
Modifier and Type | Method and Description |
---|---|
default <T> MockMaker.ConstructionMockControl<T> |
MockMaker.createConstructionMock(Class<T> type,
java.util.function.Function<MockedConstruction.Context,MockCreationSettings<T>> settingsFactory,
java.util.function.Function<MockedConstruction.Context,MockHandler<T>> handlerFactory,
MockedConstruction.MockInitializer<T> mockInitializer)
If you want to provide your own implementation of
MockMaker this method should:
Intercept all constructions of the specified type in the current thread
Only intercept the construction after being enabled.
Stops the interception when disabled.
|