public final class MockAsyncHttpClient extends Object implements SdkAsyncHttpClient, MockHttpClient
SdkAsyncHttpClient.SdkAsyncHttpClient.Builder<T extends SdkAsyncHttpClient.Builder<T>>| Constructor and Description |
|---|
MockAsyncHttpClient() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
CompletableFuture<Void> |
execute(AsyncExecuteRequest request) |
SdkHttpRequest |
getLastRequest()
Get the last request called on the mock.
|
List<SdkHttpRequest> |
getRequests()
Get all requests called on the mock.
|
void |
reset()
Resets this mock by clearing any captured requests and wiping any stubbed responses.
|
void |
stubNextResponse(HttpExecuteResponse nextResponse)
Sets up the next HTTP response that will be returned by the mock.
|
void |
stubResponses(HttpExecuteResponse... responses)
Sets the next set of HTTP responses that will be returned by the mock.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclientNamepublic CompletableFuture<Void> execute(AsyncExecuteRequest request)
execute in interface SdkAsyncHttpClientpublic void close()
close in interface AutoCloseableclose in interface SdkAutoCloseablepublic void reset()
MockHttpClientreset in interface MockHttpClientpublic List<SdkHttpRequest> getRequests()
MockHttpClientgetRequests in interface MockHttpClientpublic SdkHttpRequest getLastRequest()
MockHttpClientgetLastRequest in interface MockHttpClientpublic void stubNextResponse(HttpExecuteResponse nextResponse)
MockHttpClientstubNextResponse in interface MockHttpClientpublic void stubResponses(HttpExecuteResponse... responses)
MockHttpClientstubResponses in interface MockHttpClientCopyright © 2022. All rights reserved.