Class DefaultMockitoPlugins
java.lang.Object
org.mockito.internal.configuration.plugins.DefaultMockitoPlugins
- All Implemented Interfaces:
MockitoPlugins
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TgetDefaultPlugin(Class<T> pluginType) Returns the default plugin implementation used by Mockito.static StringgetDefaultPluginClass(String classOrAlias) Returns inline mock maker, an optional mock maker that is bundled with Mockito distribution.getMockMaker(String mockMaker) ReturnsMockMakerinstance used by Mockito with the passed namemockMaker.
-
Field Details
-
MOCK_MAKER_ALIASES
-
MEMBER_ACCESSOR_ALIASES
-
-
Constructor Details
-
DefaultMockitoPlugins
public DefaultMockitoPlugins()
-
-
Method Details
-
getDefaultPlugin
Description copied from interface:MockitoPluginsReturns the default plugin implementation used by Mockito. Mockito plugins are stateless so it is recommended to keep hold of the returned plugin implementation rather than calling this method multiple times. Each time this method is called, new instance of the plugin is created.- Specified by:
getDefaultPluginin interfaceMockitoPlugins- Parameters:
pluginType- type of the plugin, for exampleMockMaker.- Returns:
- the plugin instance
-
getDefaultPluginClass
-
getInlineMockMaker
Description copied from interface:MockitoPluginsReturns inline mock maker, an optional mock maker that is bundled with Mockito distribution. This method is needed becauseMockitoPlugins.getDefaultPlugin(Class)does not provide an instance of inline mock maker. Creates new instance each time is called so it is recommended to keep hold of the resulting object for future invocations. For more information about inline mock maker see the javadoc for mainMockitoclass.- Specified by:
getInlineMockMakerin interfaceMockitoPlugins- Returns:
- instance of inline mock maker
-
getMockMaker
Description copied from interface:MockitoPluginsReturnsMockMakerinstance used by Mockito with the passed namemockMaker.This will return the instance used by Mockito itself, not a new instance of it.
This method can be used to increase the interop of mocks created by Mockito and other libraries using Mockito mock maker API.
- Specified by:
getMockMakerin interfaceMockitoPlugins- Parameters:
mockMaker- the name of the mock maker ornullto retrieve the default mock maker- Returns:
- instance of the mock maker
-