What steps will reproduce the problem? 1. Run the test class attached. Error will be thrown. What is the expected output? What do you see instead? String "mocked" in the console but I got an error. What version of the product are you using? On what operating system? R: powermock-mockito-1.5.1-full.jar, jdk7. Please provide any additional information below. The problem is on line 37 of the class DefaultPrivatelyExpectedArguments.
And the method call:
method.invoke(mock, firstArgument, additionalArguments);
If I call the method withArguments with more than two arguments, held that: the call to the invoke method will always be considered to have only two parameters. One being the first argument and the other an array with the other arguments.
Solution: change the method signature to DefaultPrivatelyExpectedArguments#withArguments(Object... arguments) or create a temporary array for the arguments,