Testing private method using power mock which return list of Integers

user882196 picture user882196 · Aug 18, 2011 · Viewed 34.2k times · Source

I have a private method which take a list of integer value returns me a list of integer value. How can i use power mock to test it. I am new to powermock.Can i do the test with easy mock..? how..

Answer

JB Nizet picture JB Nizet · Aug 18, 2011

From the documentation, in the section called "Common - Bypass encapsulation":

Use Whitebox.invokeMethod(..) to invoke a private method of an instance or class.

You can also find examples in the same section.