Class WireMockHttpServerStub
- java.lang.Object
-
- org.springframework.cloud.contract.stubrunner.provider.wiremock.WireMockHttpServerStub
-
- All Implemented Interfaces:
HttpServerStub
public class WireMockHttpServerStub extends Object implements HttpServerStub
Abstraction over WireMock as a HTTP Server Stub.- Since:
- 1.1.0
- Author:
- Marcin Grzejszczak
-
-
Constructor Summary
Constructors Constructor Description WireMockHttpServerStub()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description inthttpsPort()booleanisAccepted(File file)booleanisRunning()intport()StringregisteredMappings()HttpServerStubregisterMappings(Collection<File> stubFiles)Registers the stub files in the HTTP server stub.HttpServerStubreset()Resets the server.HttpServerStubstart(HttpServerStubConfiguration configuration)Starts the server.HttpServerStubstop()Stops the server.
-
-
-
Method Detail
-
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
public HttpServerStub start(HttpServerStubConfiguration configuration)
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
public HttpServerStub reset()
Description copied from interface:HttpServerStubResets the server. Should return itself to allow chaining.- Specified by:
resetin interfaceHttpServerStub- Returns:
- this
-
stop
public HttpServerStub stop()
Description copied from interface:HttpServerStubStops the server. Should return itself to allow chaining.- Specified by:
stopin interfaceHttpServerStub- Returns:
- this
-
registerMappings
public HttpServerStub registerMappings(Collection<File> stubFiles)
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
public String registeredMappings()
- Specified by:
registeredMappingsin interfaceHttpServerStub- Returns:
- a collection of registered mappings.
-
isAccepted
public boolean isAccepted(File file)
- Specified by:
isAcceptedin interfaceHttpServerStub- Parameters:
file- file to check if can be accepted.- Returns:
trueif the file is a valid stub mapping
-
-