//get mock control MockControl control = MockControl.createControl(Foo.class); //Get the mock object from mock control Foo foo = (Foo) control.getMock();
·行为定义方法
public void setReturnValue(... value); public void setThrowable(Throwable throwable); public void setVoidCallable(); public void setDefaultReturnValue(... value); public void setDefaultThrowable(Throwable throwable); public void setDefaultVoidCallable(); public void setMatcher(ArgumentsMatcher matcher); public void setDefaultMatcher(ArgumentsMatcher matcher);