com.opensymphony.xwork2.mock

## Class MockInterceptor

- java.lang.Object
- - org.apache.struts2.interceptor.AbstractInterceptor
  - - com.opensymphony.xwork2.interceptor.AbstractInterceptor
    - - com.opensymphony.xwork2.mock.MockInterceptor

- All Implemented Interfaces:
    Serializable, ConditionalInterceptor, Interceptor

      public class MockInterceptor
      extends AbstractInterceptor

  Mock for an `Interceptor`.
  Author:
    Jason Carreira
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.opensymphony.xwork2.interceptor.ConditionalInterceptor

      `ConditionalInterceptor.LegacyAdapter`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_FOO_VALUE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockInterceptor()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getExpectedFoo()`
    `String` | `getFoo()`
    `int` | `hashCode()`
    `String` | `intercept(ActionInvocation invocation)` Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the DefaultActionInvocation or to short-circuit the processing and just return a String return code.
    `boolean` | `isExecuted()`
    `void` | `setExpectedFoo(String expectedFoo)`
    `void` | `setFoo(String foo)`

    - ### Methods inherited from class com.opensymphony.xwork2.interceptor.AbstractInterceptor

      `intercept, shouldIntercept, shouldIntercept`

    - ### Methods inherited from class org.apache.struts2.interceptor.AbstractInterceptor

      `destroy, init, setDisabled`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.opensymphony.xwork2.interceptor.ConditionalInterceptor

      `adapt`

    - ### Methods inherited from interface com.opensymphony.xwork2.interceptor.Interceptor

      `adapt`

    - ### Methods inherited from interface org.apache.struts2.interceptor.Interceptor

      `destroy, init`

- - ### Field Detail

    - #### DEFAULT_FOO_VALUE

          public static final String DEFAULT_FOO_VALUE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### MockInterceptor

          public MockInterceptor()

  - ### Method Detail

    - #### isExecuted

          public boolean isExecuted()

    - #### setExpectedFoo

          public void setExpectedFoo(String expectedFoo)

    - #### getExpectedFoo

          public String getExpectedFoo()

    - #### setFoo

          public void setFoo(String foo)

    - #### getFoo

          public String getFoo()

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### intercept

          public String intercept(ActionInvocation invocation)
                           throws Exception

      Allows the Interceptor to do some processing on the request before and/or after the rest of the processing of the request by the DefaultActionInvocation or to short-circuit the processing and just return a String return code.
      Specified by:
        `intercept` in class `AbstractInterceptor`
      Throws:
        `Exception`

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.