Package: groovy.mock.interceptor

## [Groovy] Class MockInterceptor

- groovy.mock.interceptor.MockInterceptor

- All Implemented Interfaces and Traits:
    PropertyAccessInterceptor

      class MockInterceptor
      extends Object
      implements PropertyAccessInterceptor

  Intercepting calls to the collaborating object and notify the expectation object.

- - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `Object` | `expectation` Expectation object that resolves and validates intercepted interactions.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `MockInterceptor()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `Object` | `afterInvoke(Object object, String methodName, Object[] arguments, Object result)` Post-invocation hook required by the interceptor contract.
    `` | `Object` | `beforeGet(Object object, String property)` Resolves an intercepted property read against the configured expectation.
    `` | `Object` | `beforeInvoke(Object object, String methodName, Object[] arguments)` Resolves an intercepted method call against the configured expectation.
    `` | `void` | `beforeSet(Object object, String property, Object newValue)` Resolves an intercepted property write against the configured expectation.
    `` | `boolean` | `doInvoke()` Indicates whether the proxy should invoke the original implementation after interception.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Property Detail

    - #### Object expectation

      Expectation object that resolves and validates intercepted interactions.

  - ### Constructor Detail

    - #### MockInterceptor()

  - ### Method Detail

    - #### Object afterInvoke(Object object, String methodName, Object[] arguments, Object result)

      Post-invocation hook required by the interceptor contract.

      Parameters:
        `object` - the invocation receiver
        `methodName` - the method name
        `arguments` - the invocation arguments
        `result` - the invocation result
      Returns:
        always `null`

    - #### Object beforeGet(Object object, String property)

      Resolves an intercepted property read against the configured expectation.

      Parameters:
        `object` - the property owner
        `property` - the property name
      Returns:
        the expectation result or MockProxyMetaClass.FALL_THROUGH_MARKER

    - #### Object beforeInvoke(Object object, String methodName, Object[] arguments)

      Resolves an intercepted method call against the configured expectation.

      Parameters:
        `object` - the invocation receiver
        `methodName` - the method name
        `arguments` - the invocation arguments
      Returns:
        the expectation result or MockProxyMetaClass.FALL_THROUGH_MARKER

    - #### void beforeSet(Object object, String property, Object newValue)

      Resolves an intercepted property write against the configured expectation.

      Parameters:
        `object` - the property owner or result holder used by the proxy
        `property` - the property name
        `newValue` - the value being assigned

    - #### boolean doInvoke()

      Indicates whether the proxy should invoke the original implementation after interception.

      Returns:
        `false` because this interceptor decides invocation explicitly