类 MockMvcClientHttpRequestFactory
- java.lang.Object
- org.springframework.test.web.client.MockMvcClientHttpRequestFactory
public class MockMvcClientHttpRequestFactory extends Object implements ClientHttpRequestFactory, AsyncClientHttpRequestFactory
AClientHttpRequestFactoryfor requests executed viaMockMvc.As of 5.0 this class also implements
AsyncClientHttpRequestFactory. However note thatAsyncRestTemplateand related classes have been deprecated at the same time.- 从以下版本开始:
- 3.2
- 作者:
- Rossen Stoyanchev
构造器概要
构造器 构造器 说明 MockMvcClientHttpRequestFactory(MockMvc mockMvc)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 AsyncClientHttpRequestcreateAsyncRequest(URI uri, HttpMethod method)Create a new asynchronousAsyncClientHttpRequestfor the specified URI and HTTP method.ClientHttpRequestcreateRequest(URI uri, HttpMethod httpMethod)Create a newClientHttpRequestfor the specified URI and HTTP method.
构造器详细资料
MockMvcClientHttpRequestFactory
public MockMvcClientHttpRequestFactory(MockMvc mockMvc)
方法详细资料
createRequest
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod)
从接口复制的说明:ClientHttpRequestFactoryCreate a newClientHttpRequestfor 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)
从接口复制的说明:AsyncClientHttpRequestFactoryCreate a new asynchronousAsyncClientHttpRequestfor 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