Package com.dougnoel.sentinel.apis
Class Response
java.lang.Object
com.dougnoel.sentinel.apis.Response
Wrapper for an hhtp response for testing the response.
- Author:
- dougnoel
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the amount of time the response took to get.Returns the http response as a Stringint
Returns the response code from the responsevoid
setResponseTime
(Duration duration) Sets the amount of time that the response took to get.
-
Field Details
-
httpResponse
protected org.apache.http.HttpResponse httpResponse -
jsonResponse
-
responseTime
-
-
Constructor Details
-
Response
- Parameters:
httpResponse
- HttpResponse the aPI call response used to create this object- Throws:
IOException
- if the parsing fails
-
-
Method Details
-
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
Sets the amount of time that the response took to get.- Parameters:
duration
-
-
getReponseTime
Returns the amount of time the response took to get.- Returns:
- Duration the response time
-