Class VarClientResponse

java.lang.Object
io.varhttp.test.VarClientResponse

public class VarClientResponse extends Object
  • Constructor Details

  • Method Details

    • assertStatusCode

      public VarClientResponse assertStatusCode(int code)
    • isOk

      public VarClientResponse isOk()
    • isInternalError

      public VarClientResponse isInternalError()
    • isBadRequest

      public VarClientResponse isBadRequest()
    • isUnsupportedMediaType

      public VarClientResponse isUnsupportedMediaType()
    • isCreated

      public VarClientResponse isCreated()
    • isNotFound

      public VarClientResponse isNotFound()
    • isNotAuthorized

      public VarClientResponse isNotAuthorized()
    • isForbidden

      public VarClientResponse isForbidden()
    • assertContentType

      public VarClientResponse assertContentType(String contentType)
    • assertContent

      public VarClientResponse assertContent(String expected)
    • assertHeader

      public VarClientResponse assertHeader(String name, String expectedValue)
    • assertHeaderSize

      public VarClientResponse assertHeaderSize(String name, int expectedSize)
    • assertOnResponse

      public VarClientResponse assertOnResponse(Consumer<HttpResponse> assertion)
    • getHeader

      public String getHeader(String name)
    • getLocation

      public String getLocation()
    • getCookies

      @Deprecated public List<String> getCookies()
      Deprecated.
      use getSetCookies() instead
      Get the list of cookies that the server has set in the response

      If a cookie is present on the client already and not set by the server in this response, it will not be included in this list

      Returns:
      list of cookies set by the server, or an empty list if no cookies were set
    • getSetCookies

      public List<String> getSetCookies()
      Get the list of cookies that the server has set in the response

      If a cookie is present on the client already and not set by the server in this response, it will not be included in this list

      Returns:
      list of cookies set by the server, or an empty list if no cookies were set
    • getContent

      public <T> T getContent(Class<T> clazz)
    • getContent

      public <T> T getContent(Type type)
    • getContent

      public String getContent()
    • downloadContent

      public InputStream downloadContent()