After reading: https://code.google.com/p/powermock/wiki/BypassEncapsulation i realized, i don't get it.
See in this example:
public class Bar{
private Foo foo;
public void initFoo(){
foo = new Foo();
}
}
How can i access the private member foo
by using PowerMock (For example to verify that foo
is not null)?
Note:
What i don't want is modifying the code with extra get
methods.
Edit:
I realized that i missed a sample code block on the linked page with the solution.
Solution:
Whitebox.getInternalState(bar, "foo");