Interface MockHttpClient
- All Known Implementing Classes:
MockAsyncHttpClient
,MockSyncHttpClient
public interface MockHttpClient
-
Method Summary
Modifier and TypeMethodDescriptionGet the last request called on the mock.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
stubNextResponse
(HttpExecuteResponse nextResponse, Duration delay) Sets up the next HTTP response that will be returned by the mock with a delay.default void
void
stubResponses
(HttpExecuteResponse... responses) Sets the next set of HTTP responses that will be returned by the mock.void
stubResponses
(Pair<HttpExecuteResponse, Duration>... responses)
-
Method Details
-
reset
void reset()Resets this mock by clearing any captured requests and wiping any stubbed responses. -
stubNextResponse
Sets up the next HTTP response that will be returned by the mock. Removes responses previously added to the mock. -
stubNextResponse200
default void stubNextResponse200() -
stubNextResponse
Sets up the next HTTP response that will be returned by the mock with a delay. Removes responses previously added to the mock. -
stubResponses
-
stubResponses
Sets the next set of HTTP responses that will be returned by the mock. Removes responses previously added to the mock. -
getLastRequest
SdkHttpRequest getLastRequest()Get the last request called on the mock. -
getRequests
List<SdkHttpRequest> getRequests()Get all requests called on the mock.
-