我想模拟以下方法:public Object doSomething(Object o);
,让它返回传入的参数。我尝试了以下代码:
Capture<Object> copyCaptcher = new Capture<Object>();
expect(mock.doSomething(capture(copyCaptcher)))
.andReturn(copyCatcher.getValue());
但是一直没有成功,我只得到了一个断言错误:java.lang.AssertionError: Nothing captured yet
。有什么建议吗?