Class DirectCallHttpServer

java.lang.Object
com.github.tomakehurst.wiremock.direct.DirectCallHttpServer
All Implemented Interfaces:
HttpServer

public class DirectCallHttpServer extends Object implements HttpServer
An implementation of the HttpServer that doesn't actually run an HTTP server.

This is to allow the use of Wiremock through direct method calls, which is then suitable for i.e. running in Serverless applications.

  • Constructor Details

  • Method Details

    • adminRequest

      public Response adminRequest(Request request)
      Retrieve the admin response that is mapped for a given request to the server.
      Parameters:
      request - the incoming admin Request
      Returns:
      the admin Response
    • stubRequest

      public Response stubRequest(Request request)
      Retrieve the stub response that is mapped for a given request to the server.
      Parameters:
      request - the incoming stub Request
      Returns:
      the stub Response that best matches the mappings
    • start

      public void start()
      Specified by:
      start in interface HttpServer
    • stop

      public void stop()
      Specified by:
      stop in interface HttpServer
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface HttpServer
    • port

      public int port()
      Specified by:
      port in interface HttpServer
    • httpsPort

      public int httpsPort()
      Specified by:
      httpsPort in interface HttpServer