Class MockHttpSender

java.lang.Object
org.openrewrite.test.MockHttpSender
All Implemented Interfaces:
org.openrewrite.ipc.http.HttpSender

public class MockHttpSender extends Object implements org.openrewrite.ipc.http.HttpSender
Issues no HTTP requests, instead returning the supplied input stream whenever send() is invoked. Convenient for writing tests that do not depend on the availability of external services.
  • Constructor Details

  • Method Details

    • withResponseHeaders

      public MockHttpSender withResponseHeaders(Map<String,List<String>> headers)
    • send

      public org.openrewrite.ipc.http.HttpSender.Response send(org.openrewrite.ipc.http.HttpSender.Request request)
      Specified by:
      send in interface org.openrewrite.ipc.http.HttpSender