Class DirectCallHttpServer
- java.lang.Object
-
- com.github.tomakehurst.wiremock.direct.DirectCallHttpServer
-
- All Implemented Interfaces:
HttpServer
public class DirectCallHttpServer extends java.lang.Object implements HttpServer
An implementation of theHttpServer
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 Summary
Constructors Constructor Description DirectCallHttpServer(Options options, AdminRequestHandler adminRequestHandler, StubRequestHandler stubRequestHandler)
Construct the Direct Call HTTP Server.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response
adminRequest(Request request)
Retrieve the admin response that is mapped for a given request to the server.int
httpsPort()
boolean
isRunning()
int
port()
void
start()
void
stop()
Response
stubRequest(Request request)
Retrieve the stub response that is mapped for a given request to the server.
-
-
-
Constructor Detail
-
DirectCallHttpServer
public DirectCallHttpServer(Options options, AdminRequestHandler adminRequestHandler, StubRequestHandler stubRequestHandler)
Construct the Direct Call HTTP Server.- Parameters:
options
- theOptions
used to configure this serveradminRequestHandler
- theAdminRequestHandler
stubRequestHandler
- theStubRequestHandler
-
-
Method Detail
-
adminRequest
public Response adminRequest(Request request)
Retrieve the admin response that is mapped for a given request to the server.
-
stubRequest
public Response stubRequest(Request request)
Retrieve the stub response that is mapped for a given request to the server.
-
start
public void start()
- Specified by:
start
in interfaceHttpServer
-
stop
public void stop()
- Specified by:
stop
in interfaceHttpServer
-
isRunning
public boolean isRunning()
- Specified by:
isRunning
in interfaceHttpServer
-
port
public int port()
- Specified by:
port
in interfaceHttpServer
-
httpsPort
public int httpsPort()
- Specified by:
httpsPort
in interfaceHttpServer
-
-