看看这张照片。Mockito 验证 Argument 发生了什么?
我想验证是否使用参数工厂调用了视图。
@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
);
你可以的论点是相同的。