Class StubResponse


  • public class StubResponse
    extends Object
    Definition of a stub http response. For creating new instances use the builder() static method.
    • Field Detail

      • EMPTY

        public static final StubResponse EMPTY
        An empty stub response containing nothing but defaults (empty body, http status 200, no headers and no delay)
    • Method Detail

      • getStatus

        public int getStatus()
        Returns:
        http status of the stub response
      • getBody

        public byte[] getBody()
        Returns:
        response body as an array of bytes
      • getEncoding

        public Charset getEncoding()
        Returns:
        encoding of the body (null if not set)
      • getHeaders

        public KeyValues getHeaders()
        Returns:
        stub response headers
      • getDelay

        public long getDelay()
        Returns:
        a delay (in millis) this stub response will be returned after