use of org.mockito.internal.invocation.MockitoMethod in project powermock by powermock.
the class MethodInterceptorFilter method intercept.
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable {
if (isEqualsMethod(method)) {
return proxy == args[0];
} else if (isHashCodeMethod(method)) {
return hashCodeForMock(proxy);
} else if (acrossJVMSerializationFeature.isWriteReplace(method)) {
return acrossJVMSerializationFeature.writeReplace(proxy);
}
MockitoMethodProxy mockitoMethodProxy = createMockitoMethodProxy(methodProxy);
new CGLIBHacker().setMockitoNamingPolicy(methodProxy);
MockitoMethod mockitoMethod = createMockitoMethod(method);
CleanTraceRealMethod realMethod = new CleanTraceRealMethod(mockitoMethodProxy);
Invocation invocation = new InvocationImpl(proxy, mockitoMethod, args, SequenceNumber.next(), realMethod, new LocationImpl());
return handler.handle(invocation);
}
Aggregations