Class DirectCallHttpServer

  • All Implemented Interfaces:
    HttpServer

    public class DirectCallHttpServer
    extends java.lang.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.

    • Method Detail

      • 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
      • port

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