Interface HttpServerStub
- All Known Implementing Classes:
WireMockHttpServerStub
public interface HttpServerStub
Describes an HTTP Server Stub.
- Since:
- 1.1.0
- Author:
- Marcin Grzejszczak
-
Method Summary
Modifier and TypeMethodDescriptiondefault intbooleanisAccepted(File file) booleanintport()registerMappings(Collection<File> stubFiles) Registers the stub files in the HTTP server stub.default HttpServerStubreset()Resets the server.start(HttpServerStubConfiguration configuration) Starts the server.stop()Stops the server.
-
Method Details
-
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
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
Resets the server. Should return itself to allow chaining.- Returns:
- this
-
registerMappings
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
- Parameters:
file- file to check if can be accepted.- Returns:
trueif the file is a valid stub mapping
-