public class DirectCallHttpServer extends java.lang.Object implements HttpServer
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 and Description |
|---|
DirectCallHttpServer(Options options,
AdminRequestHandler adminRequestHandler,
StubRequestHandler stubRequestHandler)
Construct the Direct Call HTTP Server.
|
| Modifier and Type | Method and 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.
|
public DirectCallHttpServer(Options options, AdminRequestHandler adminRequestHandler, StubRequestHandler stubRequestHandler)
options - the Options used to configure this serveradminRequestHandler - the AdminRequestHandlerstubRequestHandler - the StubRequestHandlerpublic Response adminRequest(Request request)
public Response stubRequest(Request request)
public void start()
start in interface HttpServerpublic void stop()
stop in interface HttpServerpublic boolean isRunning()
isRunning in interface HttpServerpublic int port()
port in interface HttpServerpublic int httpsPort()
httpsPort in interface HttpServer