public class MockMvcClientHttpRequestFactory extends Object implements ClientHttpRequestFactory
ClientHttpRequestFactory
for requests executed via MockMvc
.Constructor and Description |
---|
MockMvcClientHttpRequestFactory(MockMvc mockMvc) |
Modifier and Type | Method and Description |
---|---|
ClientHttpRequest |
createRequest(URI uri,
HttpMethod httpMethod)
Create a new
ClientHttpRequest for the specified URI and HTTP method. |
public MockMvcClientHttpRequestFactory(MockMvc mockMvc)
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException
ClientHttpRequestFactory
ClientHttpRequest
for the specified URI and HTTP method.
The returned request can be written to, and then executed by calling
ClientHttpRequest.execute()
.
createRequest
in interface ClientHttpRequestFactory
uri
- the URI to create a request forhttpMethod
- the HTTP method to executeIOException
- in case of I/O errors