| Package | Description |
|---|---|
| org.mockito |
Mockito is a mock library for java - see
Mockito class for usage. |
| org.mockito.internal |
Internal classes, not to be used by clients.
|
| org.mockito.internal.creation.bytebuddy |
ByteBuddy related stuff.
|
| org.mockito.internal.creation.proxy |
Mock makers based on the
Proxy utility. |
| org.mockito.internal.handler | |
| org.mockito.internal.util |
Static utils
|
| 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 | Interface and Description |
|---|---|
interface |
InternalMockHandler<T>
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
MockHandler |
ByteBuddyMockMaker.getHandler(Object mock) |
MockHandler |
SubclassByteBuddyMockMaker.getHandler(Object mock) |
MockHandler |
InlineByteBuddyMockMaker.getHandler(Object mock) |
MockHandler |
MockMethodInterceptor.getMockHandler() |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
ByteBuddyMockMaker.createMock(MockCreationSettings<T> settings,
MockHandler handler) |
<T> T |
SubclassByteBuddyMockMaker.createMock(MockCreationSettings<T> settings,
MockHandler handler) |
<T> T |
InlineByteBuddyMockMaker.createMock(MockCreationSettings<T> settings,
MockHandler handler) |
<T> Optional<T> |
ByteBuddyMockMaker.createSpy(MockCreationSettings<T> settings,
MockHandler handler,
T object) |
<T> Optional<T> |
InlineByteBuddyMockMaker.createSpy(MockCreationSettings<T> settings,
MockHandler handler,
T instance) |
<T> MockMaker.StaticMockControl<T> |
ByteBuddyMockMaker.createStaticMock(Class<T> type,
MockCreationSettings<T> settings,
MockHandler handler) |
<T> MockMaker.StaticMockControl<T> |
InlineByteBuddyMockMaker.createStaticMock(Class<T> type,
MockCreationSettings<T> settings,
MockHandler handler) |
void |
ByteBuddyMockMaker.resetMock(Object mock,
MockHandler newHandler,
MockCreationSettings settings) |
void |
SubclassByteBuddyMockMaker.resetMock(Object mock,
MockHandler newHandler,
MockCreationSettings settings) |
void |
InlineByteBuddyMockMaker.resetMock(Object mock,
MockHandler newHandler,
MockCreationSettings settings) |
| Modifier and Type | Method and Description |
|---|---|
<T> MockMaker.ConstructionMockControl<T> |
ByteBuddyMockMaker.createConstructionMock(Class<T> type,
Function<MockedConstruction.Context,MockCreationSettings<T>> settingsFactory,
Function<MockedConstruction.Context,MockHandler<T>> handlerFactory,
MockedConstruction.MockInitializer<T> mockInitializer) |
<T> MockMaker.ConstructionMockControl<T> |
InlineByteBuddyMockMaker.createConstructionMock(Class<T> type,
Function<MockedConstruction.Context,MockCreationSettings<T>> settingsFactory,
Function<MockedConstruction.Context,MockHandler<T>> handlerFactory,
MockedConstruction.MockInitializer<T> mockInitializer) |
| Constructor and Description |
|---|
MockMethodInterceptor(MockHandler handler,
MockCreationSettings mockCreationSettings) |
| Modifier and Type | Method and Description |
|---|---|
MockHandler |
ProxyMockMaker.getHandler(Object mock) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
ProxyMockMaker.createMock(MockCreationSettings<T> settings,
MockHandler handler) |
void |
ProxyMockMaker.resetMock(Object mock,
MockHandler newHandler,
MockCreationSettings settings) |
| Modifier and Type | Class and Description |
|---|---|
class |
MockHandlerImpl<T>
Invocation handler set on mock objects.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> MockHandler<T> |
MockHandlerFactory.createMockHandler(MockCreationSettings<T> settings) |
| Modifier and Type | Method and Description |
|---|---|
MockHandler |
DefaultMockingDetails.getMockHandler() |
static MockHandler<?> |
MockUtil.getMockHandler(Object mock) |
| 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,
Function<MockedConstruction.Context,MockCreationSettings<T>> settingsFactory,
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.
|
Copyright © 2025. All rights reserved.