4
看看这张图片。 Mockito验证论据是怎么回事?为什么mockito返回错误前夕参数是相同的?
我想验证视图是由参数工厂调用的。
@Test
public void shouldInitializeTheDriverWithTheRequestFactory() {
CVProxy proxy = context.create(CVProxy.class);
workflow.initialize();
verify(view).initializeWithRequestFactory(factory);
verify(view).editWithEditor(proxy, context);
}
但是,我得到这个错误是奇怪的!
Argument(s) are different! Wanted:
view.initializeWithRequestFactory(
c[email protected]13c6a22
);
-> at CreatingNewCVWorkflowTest.shouldInitializeTheDriverWithTheRequestFactory(CreatingNewCVWorkflowTest.java:53)
Actual invocation has different arguments:
view.initializeWithRequestFactory(
c[email protected]13c6a22
);
因为你可以参数是相同的。
as google ...:D – Adelin 2012-07-12 13:10:59
我在想同样的事情。 – jhericks 2012-07-12 16:07:56
无论是它还是其超类 - ['AbstractRequestFactory'](http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/web/bindery/ requestfactory/shared/impl/AbstractRequestFactory.java)和['IdFactory'](http://code.google.com/p/google-web-toolkit/source/browse/trunk/user/src/com/google/web /bindery/requestfactory/shared/impl/IdFactory.java)--实现'equals'。 – 2012-07-26 15:39:19