Class DirectCallHttpServer
java.lang.Object
com.github.tomakehurst.wiremock.direct.DirectCallHttpServer
- All Implemented Interfaces:
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 Summary
ConstructorsConstructorDescriptionDirectCallHttpServer
(Options options, AdminRequestHandler adminRequestHandler, StubRequestHandler stubRequestHandler) Construct the Direct Call HTTP Server. -
Method Summary
Modifier and TypeMethodDescriptionadminRequest
(Request request) Retrieve the admin response that is mapped for a given request to the server.int
boolean
int
port()
void
start()
void
stop()
stubRequest
(Request request) Retrieve the stub response that is mapped for a given request to the server.
-
Constructor Details
-
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 Details
-
adminRequest
Retrieve the admin response that is mapped for a given request to the server. -
stubRequest
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
-