Class Response

java.lang.Object
com.dougnoel.sentinel.apis.Response

public class Response extends Object
Wrapper for an hhtp response for testing the response.
Author:
dougnoel
  • Field Details

    • httpResponse

      protected org.apache.http.HttpResponse httpResponse
    • jsonResponse

      protected String jsonResponse
    • responseTime

      protected Duration responseTime
  • Constructor Details

    • Response

      public Response(org.apache.http.HttpResponse httpResponse) throws IOException
      Parameters:
      httpResponse - HttpResponse the aPI call response used to create this object
      Throws:
      IOException - if the parsing fails
  • Method Details

    • getResponse

      public String getResponse()
      Returns the http response as a String
      Returns:
      String the http response
    • getResponseCode

      public int getResponseCode()
      Returns the response code from the response
      Returns:
      int the status of the response
    • setResponseTime

      public void setResponseTime(Duration duration)
      Sets the amount of time that the response took to get.
      Parameters:
      duration -
    • getReponseTime

      public Duration getReponseTime()
      Returns the amount of time the response took to get.
      Returns:
      Duration the response time