This is an automated email from the ASF dual-hosted git repository.
ramyav pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/olingo-odata2.git
The following commit(s) were added to refs/heads/master by this push:
new 8449e38 [OLINGO-1362] Handling status code 420
8449e38 is described below
commit 8449e389b6166bd9a38473a599d8c7be91c31c20
Author: ramya vasanth <[email protected]>
AuthorDate: Tue Jun 4 10:11:04 2019 +0530
[OLINGO-1362] Handling status code 420
---
.../java/org/apache/olingo/odata2/api/commons/HttpStatusCodes.java | 1 +
.../test/java/org/apache/olingo/odata2/core/ODataResponseTest.java | 7 +++++++
2 files changed, 8 insertions(+)
diff --git
a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/commons/HttpStatusCodes.java
b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/commons/HttpStatusCodes.java
index e2a416f..4371a53 100644
---
a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/commons/HttpStatusCodes.java
+++
b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/commons/HttpStatusCodes.java
@@ -40,6 +40,7 @@ public enum HttpStatusCodes {
REQUEST_URI_TOO_LONG(414, "Request-URI Too Long"),
UNSUPPORTED_MEDIA_TYPE(415, "Unsupported Media Type"),
REQUESTED_RANGE_NOT_SATISFIABLE(416, "Requested Range Not Satisfiable"),
EXPECTATION_FAILED(417, "Expectation Failed"), PRECONDITION_REQUIRED(428,
"Precondition Required"),
+ METHOD_FAILED(420, "Method Failed"),
INTERNAL_SERVER_ERROR(500, "Internal Server Error"), NOT_IMPLEMENTED(501,
"Not Implemented"), BAD_GATEWAY(502,
"Bad Gateway"), SERVICE_UNAVAILABLE(503, "Service Unavailable"),
GATEWAY_TIMEOUT(504, "Gateway Timeout"),
diff --git
a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ODataResponseTest.java
b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ODataResponseTest.java
index f5fe501..f10a655 100644
---
a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ODataResponseTest.java
+++
b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ODataResponseTest.java
@@ -134,4 +134,11 @@ public class ODataResponseTest extends BaseTest {
assertEquals("id", responseCopy.getIdLiteral());
assertEquals("body", responseCopy.getEntity());
}
+
+ @Test
+ public void buildResponseWithStatusCode420() {
+ ODataResponse response = ODataResponse.entity("NOT
OK").status(HttpStatusCodes.METHOD_FAILED).build();
+ assertEquals(HttpStatusCodes.METHOD_FAILED, response.getStatus());
+ assertEquals("NOT OK", response.getEntity());
+ }
}