Class SecureStubServer

java.lang.Object
com.xebialabs.restito.server.StubServer
com.xebialabs.restito.server.secure.SecureStubServer

public class SecureStubServer extends com.xebialabs.restito.server.StubServer
This class can be removed if pull request https://github.com/mkotsur/restito/pull/46 is merged into master this just extends StubServer to adds the functionality present in that pull request
  • Field Summary

    Fields inherited from class com.xebialabs.restito.server.StubServer

    DEFAULT_PORT, secured
  • Constructor Summary

    Constructors
    Constructor
    Description
    SecureStubServer(int portRangeStart, int portRangeEnd, com.xebialabs.restito.semantics.Stub... stubs)
    This constructor allows to specify the port range beside stubs.
    SecureStubServer(int port, com.xebialabs.restito.semantics.Stub... stubs)
    This constructor allows to specify the port beside stubs.
    SecureStubServer(com.xebialabs.restito.semantics.Stub... stubs)
    Creates a server based on stubs that are used to determine behavior.
  • Method Summary

    Modifier and Type
    Method
    Description
    addStub(com.xebialabs.restito.semantics.Stub s)
    It is possible to add a stub even after the server is started
    List<com.xebialabs.restito.semantics.Call>
    Returns calls performed to the server.
    int
    Returns the port which the server is running at
    List<com.xebialabs.restito.semantics.Stub>
    Returns stubs associated with the server.
    run()
    Starts the server
    Sets the Server in Secure mode.
    void
    Alias for StubServer.run()
    Stops the server

    Methods inherited from class com.xebialabs.restito.server.StubServer

    clear, clearCalls, clearStubs, clientAuth, isRegisterCalls, setRegisterCalls

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SecureStubServer

      public SecureStubServer(com.xebialabs.restito.semantics.Stub... stubs)
      Creates a server based on stubs that are used to determine behavior.
    • SecureStubServer

      public SecureStubServer(int portRangeStart, int portRangeEnd, com.xebialabs.restito.semantics.Stub... stubs)
      This constructor allows to specify the port range beside stubs. Grizzly will select the first available port.
    • SecureStubServer

      public SecureStubServer(int port, com.xebialabs.restito.semantics.Stub... stubs)
      This constructor allows to specify the port beside stubs. If the port is busy, Restito won't try to pick different one and java.net.BindException will be thrown.
  • Method Details

    • addStub

      public SecureStubServer addStub(com.xebialabs.restito.semantics.Stub s)
      It is possible to add a stub even after the server is started
      Overrides:
      addStub in class com.xebialabs.restito.server.StubServer
    • run

      public SecureStubServer run()
      Starts the server
      Overrides:
      run in class com.xebialabs.restito.server.StubServer
    • start

      public void start()
      Alias for StubServer.run()
      Overrides:
      start in class com.xebialabs.restito.server.StubServer
    • stop

      public SecureStubServer stop()
      Stops the server
      Overrides:
      stop in class com.xebialabs.restito.server.StubServer
    • secured

      public SecureStubServer secured()
      Sets the Server in Secure mode. If it is already running, ignores the call.
      Overrides:
      secured in class com.xebialabs.restito.server.StubServer
    • getPort

      public int getPort()
      Returns the port which the server is running at
      Overrides:
      getPort in class com.xebialabs.restito.server.StubServer
    • getCalls

      public List<com.xebialabs.restito.semantics.Call> getCalls()
      Returns calls performed to the server. Returned list is actually a copy of the original one. This is done to prevent concurrency issues. See #33.
      Overrides:
      getCalls in class com.xebialabs.restito.server.StubServer
    • getStubs

      public List<com.xebialabs.restito.semantics.Stub> getStubs()
      Returns stubs associated with the server. Returned list is actually a copy of the original one. This is done to prevent concurrency issues. See #33.
      Overrides:
      getStubs in class com.xebialabs.restito.server.StubServer