public class PowerMockMaker
extends java.lang.Object
implements org.mockito.plugins.MockMaker
MockMaker
via org.mockito.internal.configuration.plugins.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
.Modifier and Type | Class and Description |
---|---|
private static class |
PowerMockMaker.PowerMockInternalMockHandler
It needs to extend InternalMockHandler because Mockito requires the type to be of InternalMockHandler and not MockHandler
|
Modifier and Type | Field and Description |
---|---|
private org.mockito.plugins.MockMaker |
cglibMockMaker |
Constructor and Description |
---|
PowerMockMaker() |
Modifier and Type | Method and Description |
---|---|
<T> T |
createMock(org.mockito.mock.MockCreationSettings<T> settings,
org.mockito.invocation.MockHandler handler) |
org.mockito.invocation.MockHandler |
getHandler(java.lang.Object mock) |
void |
resetMock(java.lang.Object mock,
org.mockito.invocation.MockHandler newHandler,
org.mockito.mock.MockCreationSettings settings) |
public <T> T createMock(org.mockito.mock.MockCreationSettings<T> settings, org.mockito.invocation.MockHandler handler)
createMock
in interface org.mockito.plugins.MockMaker
public org.mockito.invocation.MockHandler getHandler(java.lang.Object mock)
getHandler
in interface org.mockito.plugins.MockMaker
public void resetMock(java.lang.Object mock, org.mockito.invocation.MockHandler newHandler, org.mockito.mock.MockCreationSettings settings)
resetMock
in interface org.mockito.plugins.MockMaker