publicObjectdoSomething(Objecto);我想模拟的。它应该只返回它的参数。我试过了:CapturecopyCaptcher=newCapture();expect(mock.doSomething(capture(copyCaptcher))).andReturn(copyCatcher.getValue());但没有成功,我得到一个AssertionError作为java.lang.AssertionError:Nothingcaptureyet。有什么想法吗? 最佳答案 嗯,最简单的方法是在IAnswe
publicObjectdoSomething(Objecto);我想模拟的。它应该只返回它的参数。我试过了:CapturecopyCaptcher=newCapture();expect(mock.doSomething(capture(copyCaptcher))).andReturn(copyCatcher.getValue());但没有成功,我得到一个AssertionError作为java.lang.AssertionError:Nothingcaptureyet。有什么想法吗? 最佳答案 嗯,最简单的方法是在IAnswe