GrailsTestRequestEnvironmentInterceptor (Grails 6.0.0)

Package: org.grails.test.support

## [Groovy] Class GrailsTestRequestEnvironmentInterceptor

- org.grails.test.support.GrailsTestRequestEnvironmentInterceptor

-     class GrailsTestRequestEnvironmentInterceptor
      extends java.lang.Object

  Establishes a “mock” request environment suitable for running tests in.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `private static java.lang.String` | `DEFAULT_CONTROLLER_NAME` |
    `private org.springframework.context.ApplicationContext` | `applicationContext` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `static java.lang.String` | `DEFAULT_CONTROLLER_NAME`
    `org.springframework.context.ApplicationContext` | `applicationContext`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsTestRequestEnvironmentInterceptor (org.springframework.context.ApplicationContext applicationContext)`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `void` | `destroy()` Removes the mock request environment
    `` | `void` | `doInRequestEnvironment(groovy.lang.Closure body)` Passes `body` to `doInRequestEnvironment(String,Closure)` with the `DEFAULT_CONTROLLER_NAME`.
    `` | `void` | `doInRequestEnvironment(java.lang.String controllerName, groovy.lang.Closure body)` Calls `init()` before and `destroy()` after invoking `body`.
    `` | `void` | `init(java.lang.String controllerName)` Establishes a mock request environment

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### private static final java.lang.String DEFAULT_CONTROLLER_NAME

    - #### private org.springframework.context.ApplicationContext applicationContext

  - ### Property Detail

    - #### static final java.lang.String DEFAULT_CONTROLLER_NAME

    - #### org.springframework.context.ApplicationContext applicationContext

  - ### Constructor Detail

    - #### GrailsTestRequestEnvironmentInterceptor(org.springframework.context.ApplicationContext applicationContext)

  - ### Method Detail

    - #### void destroy()

      Removes the mock request environment

    - #### void doInRequestEnvironment(groovy.lang.Closure body)

      Passes `body` to `doInRequestEnvironment(String,Closure)` with the `DEFAULT_CONTROLLER_NAME`.

    - #### void doInRequestEnvironment(java.lang.String controllerName, groovy.lang.Closure body)

      Calls `init()` before and `destroy()` after invoking `body`.

    - #### void init(java.lang.String controllerName)

      Establishes a mock request environment