这就是我正在做的事情:
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()
方法..什么是变通方法?
答案 0 :(得分:1)
尝试
MockRepository.remove(Foo.class);