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 theHttpServerthat 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 ResponseadminRequest(Request request)Retrieve the admin response that is mapped for a given request to the server.inthttpsPort()booleanisRunning()intport()voidstart()voidstop()ResponsestubRequest(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- theOptionsused to configure this serveradminRequestHandler- theAdminRequestHandlerstubRequestHandler- 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:
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
-
-