Class MockAsyncClientHttpRequest
- java.lang.Object
- org.springframework.mock.http.MockHttpOutputMessage
- org.springframework.mock.http.client.MockClientHttpRequest
- org.springframework.mock.http.client.MockAsyncClientHttpRequest
- All Implemented Interfaces:
AsyncClientHttpRequest
,ClientHttpRequest
,HttpMessage
,HttpOutputMessage
,HttpRequest
public class MockAsyncClientHttpRequest extends MockClientHttpRequest implements AsyncClientHttpRequest
An extension ofMockClientHttpRequest
that also implementsAsyncClientHttpRequest
by wrapping the response in aSettableListenableFuture
.- Since:
- 4.1
- Author:
- Rossen Stoyanchev, Sam Brannen
Constructor Summary
Constructors Constructor Description MockAsyncClientHttpRequest()
MockAsyncClientHttpRequest(HttpMethod httpMethod, URI uri)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ListenableFuture<ClientHttpResponse>
executeAsync()
Execute this request asynchronously, resulting in a Future handle.Methods inherited from class org.springframework.mock.http.client.MockClientHttpRequest
execute, executeInternal, getMethod, getURI, isExecuted, setMethod, setResponse, setURI, toString
Methods inherited from class org.springframework.mock.http.MockHttpOutputMessage
getBody, getBodyAsBytes, getBodyAsString, getBodyAsString, getHeaders
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.http.HttpMessage
getHeaders
Methods inherited from interface org.springframework.http.HttpOutputMessage
getBody
Methods inherited from interface org.springframework.http.HttpRequest
getMethod, getURI
Constructor Detail
MockAsyncClientHttpRequest
public MockAsyncClientHttpRequest()
MockAsyncClientHttpRequest
public MockAsyncClientHttpRequest(HttpMethod httpMethod, URI uri)
Method Detail
executeAsync
public ListenableFuture<ClientHttpResponse> executeAsync() throws IOException
Description copied from interface:AsyncClientHttpRequest
Execute this request asynchronously, resulting in a Future handle.ClientHttpResponse
that can be read.- Specified by:
executeAsync
in interfaceAsyncClientHttpRequest
- Returns:
- the future response result of the execution
- Throws:
IOException
- in case of I/O errors