Interface MockHttpClient

All Known Implementing Classes:
MockAsyncHttpClient, MockSyncHttpClient

public interface MockHttpClient
  • Method Details

    • reset

      void reset()
      Resets this mock by clearing any captured requests and wiping any stubbed responses.
    • stubNextResponse

      void stubNextResponse(HttpExecuteResponse nextResponse)
      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

      void stubNextResponse(HttpExecuteResponse nextResponse, Duration delay)
      Sets up the next HTTP response that will be returned by the mock with a delay. Removes responses previously added to the mock.
    • stubResponses

      void stubResponses(Pair<HttpExecuteResponse,Duration>... responses)
    • stubResponses

      void stubResponses(HttpExecuteResponse... responses)
      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.