Package net.jadler.stubbing.server
Interface StubHttpServer
-
public interface StubHttpServerInterface for a stub http server component.This component represents an http server which waits for http requests and returns stub http responses according to a
StubHttpServerManagerinstance.Jadler provides a default implementation of this interface
net.jadler.stubbing.server.jetty.JettyStubHttpServerbased on an embedded jetty server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetPort()voidregisterRequestManager(RequestManager requestManager)Registers a response provider.voidstart()Starts the underlying http server.voidstop()Stops the underlying http server.
-
-
-
Method Detail
-
registerRequestManager
void registerRequestManager(RequestManager requestManager)
Registers a response provider. This component provides a response prescription (in form of aStubResponseinstance) for a given http request.- Parameters:
requestManager- response provider to use to retrieve response prescriptions.
-
start
void start() throws ExceptionStarts the underlying http server. From now, the server must be able to respond according to prescriptions returned from the registeredStubHttpServerManagerinstance.- Throws:
Exception- when ugh... something went wrong
-
stop
void stop() throws Exception
Stops the underlying http server.- Throws:
Exception- when an error occurred while stopping the server
-
getPort
int getPort()
- Returns:
- HTTP server port
-
-