@RunWith(PowerMockRunner.class) @PrepareForTest(Thing.class) public class MyTest { public void test() { // mock all static methods, rendering them useless/pointless PowerMockito.mockStatic(Thing.class) new Thing().save(); // check save was called PowerMockito.verifyStatic(); Thing.save(); } }
No comments:
Post a Comment