Open huaronghao opened 5 years ago
I guess I have the same issue, tried all possible solutions but still not solved. The solution I have tried includes but not limit to: https://stackoverflow.com/questions/38155092/powermockito-is-calling-the-method-when-i-use-doreturn-when https://stackoverflow.com/questions/14651138/powermock-mock-a-static-method-then-call-real-methods-on-all-other-statics https://stackoverflow.com/questions/35701457/mocked-private-method-is-called-instead-of-being-mocked
When I mocking a overload private method, It does not take any affect. I found this may be effected by “Matchers.any(Class clazz)” can not passed by variable parameter, and then WhiteboxImpl.java on line 870 will always pick up last passed method.
following is mycode:
When I run test,the result is: call real overloadFirst but expect: call mock method