Class PowerMockMaker
java.lang.Object
org.powermock.api.mockito.internal.mockmaker.PowerMockMaker
- All Implemented Interfaces:
org.mockito.plugins.MockMaker
A PowerMock implementation of the MockMaker. Right now it simply delegates to the default Mockito
MockMaker via Plugins.getMockMaker()
but in the future we may use it more properly.
The reason for its existence is that the current Mockito MockMaker throws exception when getting the name
from of a mock that is created by PowerMock but not know for Mockito. This is triggered when by the
MockUtil class.
For more details see the ToStringGenerator.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classIt needs to extend InternalMockHandler because Mockito requires the type to be of InternalMockHandler and not MockHandler -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TcreateMock(org.mockito.mock.MockCreationSettings<T> settings, org.mockito.invocation.MockHandler handler) org.mockito.invocation.MockHandlergetHandler(Object mock) voidresetMock(Object mock, org.mockito.invocation.MockHandler newHandler, org.mockito.mock.MockCreationSettings settings)
-
Field Details
-
cglibMockMaker
private final org.mockito.plugins.MockMaker cglibMockMaker
-
-
Constructor Details
-
PowerMockMaker
public PowerMockMaker()
-
-
Method Details
-
createMock
public <T> T createMock(org.mockito.mock.MockCreationSettings<T> settings, org.mockito.invocation.MockHandler handler) - Specified by:
createMockin interfaceorg.mockito.plugins.MockMaker
-
getHandler
- Specified by:
getHandlerin interfaceorg.mockito.plugins.MockMaker
-
resetMock
public void resetMock(Object mock, org.mockito.invocation.MockHandler newHandler, org.mockito.mock.MockCreationSettings settings) - Specified by:
resetMockin interfaceorg.mockito.plugins.MockMaker
-