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.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.openrewrite.ipc.http.HttpSender

    org.openrewrite.ipc.http.HttpSender.Method, org.openrewrite.ipc.http.HttpSender.Request, org.openrewrite.ipc.http.HttpSender.Response
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.openrewrite.ipc.http.HttpSender.Response
    send(org.openrewrite.ipc.http.HttpSender.Request request)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.openrewrite.ipc.http.HttpSender

    delete, get, head, newRequest, options, post, put
  • Constructor Details

  • Method Details

    • 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