Class MockServer

java.lang.Object
software.xdev.mockserver.lifecycle.LifeCycle
software.xdev.mockserver.netty.MockServer
All Implemented Interfaces:
Closeable, AutoCloseable, Stoppable

public class MockServer extends LifeCycle
  • Constructor Details

    • MockServer

      public MockServer(Integer... localPorts)
      Start the instance using the ports provided
      Parameters:
      localPorts - the local port(s) to use, use 0 or no vararg values to specify any free port
    • MockServer

      public MockServer(ServerConfiguration configuration, Integer... localPorts)
      Start the instance using the ports provided
      Parameters:
      localPorts - the local port(s) to use, use 0 or no vararg values to specify any free port
    • MockServer

      public MockServer(ProxyConfiguration proxyConfiguration, Integer... localPorts)
      Start the instance using the ports provided configuring forwarded or proxied requests to go via an additional proxy
      Parameters:
      proxyConfiguration - the proxy configuration to send requests forwarded or proxied by MockServer via another proxy
      localPorts - the local port(s) to use, use 0 or no vararg values to specify any free port
    • MockServer

      public MockServer(ServerConfiguration configuration, List<ProxyConfiguration> proxyConfigurations, Integer... localPorts)
      Start the instance using the ports provided configuring forwarded or proxied requests to go via an additional proxy
      Parameters:
      proxyConfigurations - the proxy configuration to send requests forwarded or proxied by MockServer via another proxy
      localPorts - the local port(s) to use, use 0 or no vararg values to specify any free port
    • MockServer

      public MockServer(Integer remotePort, String remoteHost, Integer... localPorts)
      Start the instance using the ports provided
      Parameters:
      remotePort - the port of the remote server to connect to
      remoteHost - the hostname of the remote server to connect to (if null defaults to "localhost")
      localPorts - the local port(s) to use
    • MockServer

      public MockServer(ServerConfiguration configuration, Integer remotePort, String remoteHost, Integer... localPorts)
      Start the instance using the ports provided
      Parameters:
      remotePort - the port of the remote server to connect to
      remoteHost - the hostname of the remote server to connect to (if null defaults to "localhost")
      localPorts - the local port(s) to use
    • MockServer

      public MockServer(ServerConfiguration configuration, ProxyConfiguration proxyConfiguration, String remoteHost, Integer remotePort, Integer... localPorts)
      Start the instance using the ports provided configuring forwarded or proxied requests to go via an additional proxy
      Parameters:
      localPorts - the local port(s) to use
      remoteHost - the hostname of the remote server to connect to (if null defaults to "localhost")
      remotePort - the port of the remote server to connect to
    • MockServer

      public MockServer(ServerConfiguration configuration, List<ProxyConfiguration> proxyConfigurations, String remoteHost, Integer remotePort, Integer... localPorts)
      Start the instance using the ports provided configuring forwarded or proxied requests to go via an additional proxy
      Parameters:
      localPorts - the local port(s) to use
      remoteHost - the hostname of the remote server to connect to (if null defaults to "localhost")
      remotePort - the port of the remote server to connect to
  • Method Details