use of org.powermock.api.mockito.invocation.MockitoMethodInvocationControl in project powermock by powermock.
the class PowerMockitoStubberImpl method when.
@Override
public <T> T when(final T instanceMock) {
final MockitoMethodInvocationControl invocationControl = (MockitoMethodInvocationControl) MockRepository.getInstanceMethodInvocationControl(instanceMock);
final T returnValue;
if (invocationControl == null) {
returnValue = stubber.when(instanceMock);
} else {
final Object mock = invocationControl.getMockHandlerAdaptor().getMock();
stubber.when(mock);
returnValue = instanceMock;
}
return returnValue;
}
Aggregations