You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you try to mock private methods with multiple arguments via
any PowerMockito method using DefaultMethodExpectationSetup
you get
java.lang.IllegalArgumentException: wrong number of arguments
The problem is reproducible in 1.4.6 version.
It is caused by wrong arguments passed into method.invoke:
method.invoke(object, firstArgument, additionalArguments)
where an array of additional arguments is treated as single argument.
Instead it should be
method.invoke(object, firstAndAdditionalArgumentsArray)
From schiz...@gmail.com on November 07, 2010 00:46:45
When you try to mock private methods with multiple arguments via
any PowerMockito method using DefaultMethodExpectationSetup
you get
java.lang.IllegalArgumentException: wrong number of arguments
The problem is reproducible in 1.4.6 version.
It is caused by wrong arguments passed into method.invoke:
method.invoke(object, firstArgument, additionalArguments)
where an array of additional arguments is treated as single argument.
Instead it should be
method.invoke(object, firstAndAdditionalArgumentsArray)
See patch and test attached.
Mvh,
Stas Chizhov
Attachment: DefaultMethodExpectationSetupTest.java mockito-api-method-exp-setup-fix.diff
Original issue: http://code.google.com/p/powermock/issues/detail?id=289
The text was updated successfully, but these errors were encountered: