Mockito继续拦截我在DAO中创建的函数并随机返回0.我希望该函数能够实际运行。我在哪里可以配置这个mockito野兽单独留下这个功能?
调试器跳到这里而不是进入我的spring dao:
public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy)
throws Throwable {
if (objectMethodsGuru.isEqualsMethod(method)) {
return proxy == args[0];
} else if (objectMethodsGuru.isHashCodeMethod(method)) {
return hashCodeForMock(proxy);
}
MockitoMethodProxy mockitoMethodProxy = createMockitoMethodProxy(methodProxy);
cglibHacker.setMockitoNamingPolicy(mockitoMethodProxy);
MockitoMethod mockitoMethod = createMockitoMethod(method);
FilteredCGLIBProxyRealMethod realMethod = new FilteredCGLIBProxyRealMethod(mockitoMethodProxy);
Invocation invocation = new Invocation(proxy, mockitoMethod, args, SequenceNumber.next(), realMethod);
return handler.handle(invocation);
}