Interface HttpServerStub

  • All Known Implementing Classes:
    WireMockHttpServerStub

    public interface HttpServerStub
    Describes an HTTP Server Stub.
    Since:
    1.1.0
    Author:
    Marcin Grzejszczak
    • Method Detail

      • port

        int port()
        Returns:
        port on which the server is running. Return -1 if not applicable.
      • httpsPort

        default int httpsPort()
        Returns:
        https port on which the server is running. Return -1 if not applicable.
      • isRunning

        boolean isRunning()
        Returns:
        true if the server is running
      • 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:
        true if the file is a valid stub mapping