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

org.springframework.test.web.client

## Class MockMvcClientHttpRequestFactory

- java.lang.Object
- - org.springframework.test.web.client.MockMvcClientHttpRequestFactory

- All Implemented Interfaces:
    ClientHttpRequestFactory

      public class MockMvcClientHttpRequestFactory
      extends Object
      implements ClientHttpRequestFactory

  A `ClientHttpRequestFactory` for requests executed via `MockMvc`.
  Since:
    3.2
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MockMvcClientHttpRequestFactory(MockMvc mockMvc)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ClientHttpRequest` | `createRequest(URI uri, HttpMethod httpMethod)` Create a new `ClientHttpRequest` for the specified URI and HTTP method.

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

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

- - ### Constructor Detail

    - #### MockMvcClientHttpRequestFactory

          public MockMvcClientHttpRequestFactory(MockMvc mockMvc)

  - ### Method Detail

    - #### createRequest

          public ClientHttpRequest createRequest(URI uri,
                                        HttpMethod httpMethod)
                                          throws IOException

      Description copied from interface: `ClientHttpRequestFactory`
      Create a new `ClientHttpRequest` for the specified URI and HTTP method.

      The returned request can be written to, and then executed by calling `ClientHttpRequest.execute()`.

      Specified by:
        `createRequest` in interface `ClientHttpRequestFactory`
      Parameters:
        `uri` - the URI to create a request for
        `httpMethod` - the HTTP method to execute
      Returns:
        the created request
      Throws:
        `IOException` - in case of I/O errors