我一直在尝试实现 PowerMockito.Answer 一段时间但仍然卡住.. 这是代码
PowerMockito.mockStatic(testLog.class);
PowerMockito.doAnswer(new Answer<Void>() {
public Void answer(InvocationOnMock invocation) throws Throwable {
//Method method = invocation.getMethod();
System.out.println("This Method got called ");
return null;
}
}).when(testLog.class);
//calling the testLog.log method
testLog.log(....)
它会运行得很好,但不用说 println ......请帮助......!问候
詹姆士