public class MockClosureProxy extends AbstractClosureProxy
This closure proxy stores an expectation and checks it before each call to the target closure. It is used by the Grails mocking framework.
| Constructor and description |
|---|
MockClosureProxy(Closure<?> target, String methodName, Object expectation)Constructor. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected Closure<?> |
createWrapper(Closure<?> c)Creates a new MockClosureProxy wrapping the given
closure. |
|
protected void |
doAfterCall(Object[] args)Empty implementation. |
|
protected void |
doBeforeCall(Object[] args)Checks whether the target "method" is expected or not, on the basis that this closure is mocking a method with the name methodName. |
| Methods inherited from class | Name |
|---|---|
class AbstractClosureProxy |
asWritable, call, createWrapper, curry, doAfterCall, doBeforeCall, equals, getDelegate, getDirective, getMaximumNumberOfParameters, getParameterTypes, getProperty, getResolveStrategy, hashCode, isCase, setDelegate, setDirective, setProperty, setResolveStrategy |
Creates a new MockClosureProxy wrapping the given
closure.
c - The closure to wrap.Empty implementation.
args - The arguments to the target closure.