GrailsWebMockUtil (Grails 6.0.0)

Package: grails.util

## [Groovy] Class GrailsWebMockUtil

- grails.util.GrailsWebMockUtil

-     @groovy.transform.CompileStatic
      class GrailsWebMockUtil
      extends java.lang.Object

  Authors:
    Jeff Brown
  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsWebMockUtil ()`

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `static GrailsWebRequest` | `bindMockWebRequest(org.springframework.web.context.WebApplicationContext ctx)` Binds a Mock implementation of a GrailsWebRequest object to the current thread.
    `` | `static GrailsWebRequest` | `bindMockWebRequest(org.springframework.context.ApplicationContext ctx, org.springframework.mock.web.MockHttpServletRequest request, org.springframework.mock.web.MockHttpServletResponse response)` Binds a Mock implementation of a GrailsWebRequest object to the current thread.
    `` | `static GrailsWebRequest` | `bindMockWebRequest()` Binds a Mock implementation of a GrailsWebRequest object to the current thread.
    `` | `static GrailsWebRequest` | `bindMockWebRequest(javax.servlet.ServletContext servletContext, org.springframework.mock.web.MockHttpServletRequest request, org.springframework.mock.web.MockHttpServletResponse response)`

  - ### 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()`

- - ### Constructor Detail

    - #### GrailsWebMockUtil()

  - ### Method Detail

    - #### static GrailsWebRequest bindMockWebRequest(org.springframework.web.context.WebApplicationContext ctx)

      Binds a Mock implementation of a GrailsWebRequest object to the current thread. The mock version uses instances of the Spring MockHttpServletRequest, MockHttpServletResponse and MockServletContext classes.

      Parameters:
        `ctx` - The WebApplicationContext to use
      See Also:
        org.springframework.mock.web.MockHttpServletRequest
        org.springframework.mock.web.MockHttpServletResponse
        org.springframework.mock.web.MockServletContext
      Returns:
        The GrailsWebRequest instance

    - #### static GrailsWebRequest bindMockWebRequest(org.springframework.context.ApplicationContext ctx, org.springframework.mock.web.MockHttpServletRequest request, org.springframework.mock.web.MockHttpServletResponse response)

      Binds a Mock implementation of a GrailsWebRequest object to the current thread. The mock version uses instances of the Spring MockHttpServletRequest, MockHttpServletResponse and MockServletContext classes.

      Parameters:
        `ctx` - The WebApplicationContext to use
        `request` - The request
        `response` - The response
      See Also:
        org.springframework.mock.web.MockHttpServletRequest
        org.springframework.mock.web.MockHttpServletResponse
        org.springframework.mock.web.MockServletContext
      Returns:
        The GrailsWebRequest instance

    - #### static GrailsWebRequest bindMockWebRequest()

      Binds a Mock implementation of a GrailsWebRequest object to the current thread. The mock version uses instances of the Spring MockHttpServletRequest, MockHttpServletResponse and MockServletContext classes.

      See Also:
        org.springframework.mock.web.MockHttpServletRequest
        org.springframework.mock.web.MockHttpServletResponse
        org.springframework.mock.web.MockServletContext
      Returns:
        The GrailsWebRequest instance

    - #### static GrailsWebRequest bindMockWebRequest(javax.servlet.ServletContext servletContext, org.springframework.mock.web.MockHttpServletRequest request, org.springframework.mock.web.MockHttpServletResponse response)