类 MockMvcClientHttpRequestFactory
- java.lang.Object
- org.springframework.test.web.client.MockMvcClientHttpRequestFactory
public class MockMvcClientHttpRequestFactory extends Object implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory
AClientHttpRequestFactory
for requests executed viaMockMvc
.As of 5.0 this class also implements
AsyncClientHttpRequestFactory
. However note thatAsyncRestTemplate
and related classes have been deprecated at the same time.- 从以下版本开始:
- 3.2
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 MockMvcClientHttpRequestFactory(MockMvc mockMvc)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 AsyncClientHttpRequest
createAsyncRequest(URI uri, HttpMethod method)
Create a new asynchronousAsyncClientHttpRequest
for the specified URI and HTTP method.ClientHttpRequest
createRequest(URI uri, HttpMethod httpMethod)
Create a newClientHttpRequest
for the specified URI and HTTP method.
构造器详细资料
MockMvcClientHttpRequestFactory
public MockMvcClientHttpRequestFactory(MockMvc mockMvc)
方法详细资料
createRequest
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod)
从接口复制的说明:ClientHttpRequestFactory
Create a newClientHttpRequest
for the specified URI and HTTP method.The returned request can be written to, and then executed by calling
ClientHttpRequest.execute()
.- 指定者:
createRequest
在接口中ClientHttpRequestFactory
- 参数:
uri
- the URI to create a request forhttpMethod
- the HTTP method to execute- 返回:
- the created request
createAsyncRequest
public AsyncClientHttpRequest createAsyncRequest(URI uri, HttpMethod method)
从接口复制的说明:AsyncClientHttpRequestFactory
Create a new asynchronousAsyncClientHttpRequest
for the specified URI and HTTP method.The returned request can be written to, and then executed by calling
AsyncClientHttpRequest.executeAsync()
.- 指定者:
createAsyncRequest
在接口中AsyncClientHttpRequestFactory
- 参数:
uri
- the URI to create a request formethod
- the HTTP method to execute- 返回:
- the created request