Class EmptyRequest

java.lang.Object
com.codingchili.core.testing.EmptyRequest
All Implemented Interfaces:
Messageable, Request

public class EmptyRequest extends Object implements Request
An empty request for testing.
  • Constructor Details

    • EmptyRequest

      public EmptyRequest()
  • Method Details

    • error

      public void error(Throwable exception)
      Description copied from interface: Request
      Write an error and code to the response.
      Specified by:
      error in interface Request
      Parameters:
      exception - the exception that caused the error.
    • write

      public void write(Object object)
      Description copied from interface: Messageable
      Writes an object to the connection that backs the current request.
      Specified by:
      write in interface Messageable
      Parameters:
      object - the object to be written.
    • accept

      public void accept()
      Description copied from interface: Request
      Accepts the request indicating that it was processed successfully but that there is no response.
      Specified by:
      accept in interface Request
    • route

      public String route()
      Description copied from interface: Request
      Get the route from the request, the route specifies with method that should be invoked.
      Specified by:
      route in interface Request
      Returns:
      the requested route
    • target

      public String target()
      Description copied from interface: Request
      The target node of the request. The target specifies which service or which sub-service that the requested route resides in.
      Specified by:
      target in interface Request
      Returns:
      the target node
    • token

      public Token token()
      Description copied from interface: Request
      Get the request token sent with the request.
      Specified by:
      token in interface Request
      Returns:
      the requests token
    • connection

      public Connection connection()
      Specified by:
      connection in interface Request
      Returns:
      the underlying connection of the request, may be called multiple times per request returning the same connection object.
    • data

      public io.vertx.core.json.JsonObject data()
      Description copied from interface: Request
      Get the raw data of the request as a json object
      Specified by:
      data in interface Request
      Returns:
      the raw data of the request
    • timeout

      public int timeout()
      Description copied from interface: Request
      Get the request timeout which indicates how long the sender is waiting until the request is considered to have timed out.

      defaults to #ListenerSettings.DEFAULT_TIMEOUT

      Specified by:
      timeout in interface Request
      Returns:
      milliseconds specifying the timeout of the request
    • size

      public int size()
      Specified by:
      size in interface Request
      Returns:
      the size of the request in bytes.
    • maxSize

      public int maxSize()
      Description copied from interface: Request
      Specified by:
      maxSize in interface Request
      Returns:
      the maximum number of bytes allowed in a single request.