這是我在做什麼:如何重置PowerMockito.whenNew()行爲?
PowerMockito.mockStatic(Foo.class);
PowerMockito.whenNew(Foo.class).withNoArguments().thenReturn(null);
Foo foo1 = new Foo();
assert foo1 == null; // works fine
//...
// now I want PowerMockito to stop mocking the call
Foo foo2 = new Foo();
assert foo2 != null;
我找不到PowerMockito.reset()
方法。什麼是一個解決方法嗎?
這是不可能的時刻:http://code.google.com/p/powermock/issues/detail?id=281 – yegor256