I use PowerMock 1.4.7 and JUnit 4.8.2
I need to mock only some static methods and I want others (from the same class) just to return original value. When I mock with
You can also use the stubbing API:
stub(method(MyStaticClass.class, "getB")).toReturn("B");
Edit:
To use stub and method statically import methods from these packages:
org.powermock.api.support.membermodification.MemberModifierorg.powermock.api.support.membermodification.MemberMatcherFor more info refer to the documentation