Class JsonErrorResponse
- java.lang.Object
-
- de.hybris.platform.odata2services.util.JsonErrorResponse
-
public class JsonErrorResponse extends java.lang.ObjectA helper class for simpler evaluation of error reponses in the tests.
-
-
Constructor Summary
Constructors Constructor Description JsonErrorResponse(org.apache.olingo.odata2.api.commons.HttpStatusCodes status, JsonObject json)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JsonErrorResponsecreateFrom(org.apache.olingo.odata2.api.processor.ODataResponse response)Creates this error responsejava.lang.StringgetErrorCode()Retrieves error code reported in the response body.java.lang.StringgetMessage()Retrieves error message reported in the response body.intgetStatusCode()Retrieves HTTP status code of the response.
-
-
-
Constructor Detail
-
JsonErrorResponse
public JsonErrorResponse(org.apache.olingo.odata2.api.commons.HttpStatusCodes status, JsonObject json)
-
-
Method Detail
-
createFrom
public static JsonErrorResponse createFrom(org.apache.olingo.odata2.api.processor.ODataResponse response) throws org.apache.olingo.odata2.api.exception.ODataException
Creates this error response- Parameters:
response- OData2 response received in the test- Throws:
org.apache.olingo.odata2.api.exception.ODataException- if response body cannot be read
-
getStatusCode
public int getStatusCode()
Retrieves HTTP status code of the response.- Returns:
- HTTP status code even, if response is not error but is successful
-
getErrorCode
public java.lang.String getErrorCode()
Retrieves error code reported in the response body.- Returns:
- value of the
"error.code"path in the response body ornull, if error code is not present in the response body.
-
getMessage
public java.lang.String getMessage()
Retrieves error message reported in the response body.- Returns:
- value of the
"error.message.value"path in the response body ornull, if error message is not present in the body.
-
-