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.intbooleanintport()voidstart()voidstop()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- theOptionsused to configure this serveradminRequestHandler- theAdminRequestHandlerstubRequestHandler- 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:
startin interfaceHttpServer
-
stop
public void stop()- Specified by:
stopin interfaceHttpServer
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceHttpServer
-
port
public int port()- Specified by:
portin interfaceHttpServer
-
httpsPort
public int httpsPort()- Specified by:
httpsPortin interfaceHttpServer
-