看看这张照片. Mockito验证Argument的情况如何? 我想验证使用参数工厂调用视图. @Test public void shouldInitializeTheDriverWithTheRequestFactory() { CVProxy proxy = context.create(CVProxy.class); workflow.initialize(
我想验证使用参数工厂调用视图.
@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(
com.google.web.bindery.requestfactory.vm.InProcessRequestFactory@13c6a22
);
-> at CreatingNewCVWorkflowTest.shouldInitializeTheDriverWithTheRequestFactory(CreatingNewCVWorkflowTest.java:53)
Actual invocation has different arguments:
view.initializeWithRequestFactory(
com.google.web.bindery.requestfactory.vm.InProcessRequestFactory@13c6a22
);
正如你所能,参数是IDENTICAL.
工厂实例是否可能有错误实现的equals方法(以便equals方法报告对象不等于它自己)?