Interface HttpServerStub
-
- All Known Implementing Classes:
WireMockHttpServerStub
public interface HttpServerStubDescribes an HTTP Server Stub.- Since:
- 1.1.0
- Author:
- Marcin Grzejszczak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default inthttpsPort()booleanisAccepted(File file)booleanisRunning()intport()StringregisteredMappings()HttpServerStubregisterMappings(Collection<File> stubFiles)Registers the stub files in the HTTP server stub.default HttpServerStubreset()Resets the server.HttpServerStubstart(HttpServerStubConfiguration configuration)Starts the server.HttpServerStubstop()Stops the server.
-
-
-
Method Detail
-
port
int port()
- Returns:
- port on which the server is running. Return
-1if not applicable.
-
httpsPort
default int httpsPort()
- Returns:
- https port on which the server is running. Return
-1if not applicable.
-
isRunning
boolean isRunning()
- Returns:
trueif the server is running
-
start
HttpServerStub start(HttpServerStubConfiguration configuration)
Starts the server. Should return itself to allow chaining.- Parameters:
configuration- - setup for the given stub- Returns:
- this
-
stop
HttpServerStub stop()
Stops the server. Should return itself to allow chaining.- Returns:
- this
-
reset
default HttpServerStub reset()
Resets the server. Should return itself to allow chaining.- Returns:
- this
-
registerMappings
HttpServerStub registerMappings(Collection<File> stubFiles)
Registers the stub files in the HTTP server stub. Should return itself to allow chaining.- Parameters:
stubFiles- collection of files containing stubs- Returns:
- this
-
registeredMappings
String registeredMappings()
- Returns:
- a collection of registered mappings.
-
isAccepted
boolean isAccepted(File file)
- Parameters:
file- file to check if can be accepted.- Returns:
trueif the file is a valid stub mapping
-
-