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 Details

    • WireMockHttpServerStub

      public WireMockHttpServerStub()
  • Method Details

    • port

      public int port()
      Specified by:
      port in interface HttpServerStub
      Returns:
      port on which the server is running. Return -1 if not applicable.
    • isRunning

      public boolean isRunning()
      Specified by:
      isRunning in interface HttpServerStub
      Returns:
      true if the server is running
    • start

      public HttpServerStub start(HttpServerStubConfiguration configuration)
      Description copied from interface: HttpServerStub
      Starts the server. Should return itself to allow chaining.
      Specified by:
      start in interface HttpServerStub
      Parameters:
      configuration - - setup for the given stub
      Returns:
      this
    • httpsPort

      public int httpsPort()
      Specified by:
      httpsPort in interface HttpServerStub
      Returns:
      https port on which the server is running. Return -1 if not applicable.
    • reset

      public HttpServerStub reset()
      Description copied from interface: HttpServerStub
      Resets the server. Should return itself to allow chaining.
      Specified by:
      reset in interface HttpServerStub
      Returns:
      this
    • stop

      public HttpServerStub stop()
      Description copied from interface: HttpServerStub
      Stops the server. Should return itself to allow chaining.
      Specified by:
      stop in interface HttpServerStub
      Returns:
      this
    • registerMappings

      public HttpServerStub registerMappings(Collection<File> stubFiles)
      Description copied from interface: HttpServerStub
      Registers the stub files in the HTTP server stub. Should return itself to allow chaining.
      Specified by:
      registerMappings in interface HttpServerStub
      Parameters:
      stubFiles - collection of files containing stubs
      Returns:
      this
    • registeredMappings

      public String registeredMappings()
      Specified by:
      registeredMappings in interface HttpServerStub
      Returns:
      a collection of registered mappings.
    • isAccepted

      public boolean isAccepted(File file)
      Specified by:
      isAccepted in interface HttpServerStub
      Parameters:
      file - file to check if can be accepted.
      Returns:
      true if the file is a valid stub mapping