类 MockClientHttpRequest
java.lang.Object
cn.taketoday.mock.http.MockHttpOutputMessage
cn.taketoday.mock.http.client.MockClientHttpRequest
- 所有已实现的接口:
cn.taketoday.http.client.ClientHttpRequest,cn.taketoday.http.HttpMessage,cn.taketoday.http.HttpOutputMessage,cn.taketoday.http.HttpRequest
public class MockClientHttpRequest
extends MockHttpOutputMessage
implements cn.taketoday.http.client.ClientHttpRequest
Mock implementation of
ClientHttpRequest.- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Sam Brannen
-
字段概要
字段修饰符和类型字段说明private cn.taketoday.http.client.ClientHttpResponseprivate booleanprivate cn.taketoday.http.HttpMethodprivate URI -
构造器概要
构造器构造器说明Default constructor.MockClientHttpRequest(cn.taketoday.http.HttpMethod httpMethod, URI uri) Create an instance with the given HttpMethod and URI. -
方法概要
修饰符和类型方法说明final cn.taketoday.http.client.ClientHttpResponseexecute()protected cn.taketoday.http.client.ClientHttpResponseThe default implementation returns the configuredresponse.cn.taketoday.http.HttpMethod已过时。getURI()booleanvoidsetMethod(cn.taketoday.http.HttpMethod httpMethod) voidsetResponse(cn.taketoday.http.client.ClientHttpResponse clientHttpResponse) voidtoString()从类继承的方法 cn.taketoday.mock.http.MockHttpOutputMessage
getBody, getBodyAsBytes, getBodyAsString, getBodyAsString, getHeaders从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 cn.taketoday.http.HttpMessage
getHeaders从接口继承的方法 cn.taketoday.http.HttpOutputMessage
getBody, sendFile, sendFile, sendFile, setContentType, supportsZeroCopy
-
字段详细资料
-
httpMethod
private cn.taketoday.http.HttpMethod httpMethod -
uri
-
clientHttpResponse
@Nullable private cn.taketoday.http.client.ClientHttpResponse clientHttpResponse -
executed
private boolean executed
-
-
构造器详细资料
-
MockClientHttpRequest
public MockClientHttpRequest()Default constructor. -
MockClientHttpRequest
Create an instance with the given HttpMethod and URI.
-
-
方法详细资料
-
setMethod
public void setMethod(cn.taketoday.http.HttpMethod httpMethod) -
getMethod
public cn.taketoday.http.HttpMethod getMethod()- 指定者:
getMethod在接口中cn.taketoday.http.HttpRequest
-
getMethodValue
已过时。- 指定者:
getMethodValue在接口中cn.taketoday.http.HttpRequest
-
setURI
-
getURI
- 指定者:
getURI在接口中cn.taketoday.http.HttpRequest
-
setResponse
public void setResponse(cn.taketoday.http.client.ClientHttpResponse clientHttpResponse) -
isExecuted
public boolean isExecuted() -
execute
- 指定者:
execute在接口中cn.taketoday.http.client.ClientHttpRequest- 抛出:
IOException- 另请参阅:
-
executeInternal
The default implementation returns the configuredresponse.Override this method to execute the request and provide a response, potentially different than the configured response.
- 抛出:
IOException
-
toString
-