Class JsonErrorResponse
java.lang.Object
de.hybris.platform.odata2services.util.JsonErrorResponse
A helper class for simpler evaluation of error reponses in the tests.
-
Constructor Summary
ConstructorsConstructorDescriptionJsonErrorResponse(org.apache.olingo.odata2.api.commons.HttpStatusCodes status, JsonObject json) -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonErrorResponsecreateFrom(org.apache.olingo.odata2.api.processor.ODataResponse response) Creates this error responseRetrieves error code reported in the response body.Retrieves error message reported in the response body.intRetrieves HTTP status code of the response.
-
Constructor Details
-
JsonErrorResponse
public JsonErrorResponse(org.apache.olingo.odata2.api.commons.HttpStatusCodes status, JsonObject json)
-
-
Method Details
-
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
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
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.
-