MockMvc (Spring Framework 3.2.1.RELEASE API)
Date: 2013-01-24

org.springframework.test.web.servlet

## Class MockMvc

- java.lang.Object
- - org.springframework.test.web.servlet.MockMvc

-     public final class MockMvc
      extends Object

  Main entry point for server-side Spring MVC test support.

  Below is an example:

       static imports:
       MockMvcBuilders.*, MockMvcRequestBuilders.*, MockMvcResultMatchers.*

       WebApplicationContext wac = ...;

       MockMvc mockMvc = webAppContextSetup(wac).build();

       mockMvc.perform(get("/form"))
           .andExpect(status().isOk())
           .andExpect(content().mimeType("text/html"))
           .andExpect(forwardedUrl("/WEB-INF/layouts/main.jsp"));

  Since:
    3.2
  Author:
    Rossen Stoyanchev, Rob Winch

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ResultActions` | `perform(RequestBuilder requestBuilder)` Perform a request and return a type that allows chaining further actions, such as asserting expectations, on the result.

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

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

- - ### Method Detail

    - #### perform

          public ResultActions perform(RequestBuilder requestBuilder)
                                throws Exception

      Perform a request and return a type that allows chaining further actions, such as asserting expectations, on the result.
      Parameters:
        `requestBuilder` - used to prepare the request to execute; see static factory methods in `MockMvcRequestBuilders`
      Returns:
        an instance of `ResultActions`; never `null`
      Throws:
        `Exception`
      See Also:
        `MockMvcRequestBuilders`, `MockMvcResultMatchers`