Class WireMockHttpServerStub
java.lang.Object
org.springframework.cloud.contract.stubrunner.provider.wiremock.WireMockHttpServerStub
- All Implemented Interfaces:
HttpServerStub
Abstraction over WireMock as a HTTP Server Stub.
- Since:
- 1.1.0
- Author:
- Marcin Grzejszczak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanisAccepted(File file) booleanintport()registerMappings(Collection<File> stubFiles) Registers the stub files in the HTTP server stub.reset()Resets the server.start(HttpServerStubConfiguration configuration) Starts the server.stop()Stops the server.
-
Constructor Details
-
WireMockHttpServerStub
public WireMockHttpServerStub()
-
-
Method Details
-
port
public int port()- Specified by:
portin interfaceHttpServerStub- Returns:
- port on which the server is running. Return
-1if not applicable.
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceHttpServerStub- Returns:
trueif the server is running
-
start
Description copied from interface:HttpServerStubStarts the server. Should return itself to allow chaining.- Specified by:
startin interfaceHttpServerStub- Parameters:
configuration- - setup for the given stub- Returns:
- this
-
httpsPort
public int httpsPort()- Specified by:
httpsPortin interfaceHttpServerStub- Returns:
- https port on which the server is running. Return
-1if not applicable.
-
reset
Description copied from interface:HttpServerStubResets the server. Should return itself to allow chaining.- Specified by:
resetin interfaceHttpServerStub- Returns:
- this
-
stop
Description copied from interface:HttpServerStubStops the server. Should return itself to allow chaining.- Specified by:
stopin interfaceHttpServerStub- Returns:
- this
-
registerMappings
Description copied from interface:HttpServerStubRegisters the stub files in the HTTP server stub. Should return itself to allow chaining.- Specified by:
registerMappingsin interfaceHttpServerStub- Parameters:
stubFiles- collection of files containing stubs- Returns:
- this
-
registeredMappings
- Specified by:
registeredMappingsin interfaceHttpServerStub- Returns:
- a collection of registered mappings.
-
isAccepted
- Specified by:
isAcceptedin interfaceHttpServerStub- Parameters:
file- file to check if can be accepted.- Returns:
trueif the file is a valid stub mapping
-