From commits-return-12798-archive-asf-public=cust-asf.ponee.io@olingo.apache.org Tue Jun 4 04:41:25 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id B593018062F for ; Tue, 4 Jun 2019 06:41:24 +0200 (CEST) Received: (qmail 7516 invoked by uid 500); 4 Jun 2019 04:41:24 -0000 Mailing-List: contact commits-help@olingo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@olingo.apache.org Delivered-To: mailing list commits@olingo.apache.org Received: (qmail 7507 invoked by uid 99); 4 Jun 2019 04:41:24 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Jun 2019 04:41:24 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id DF1148A976; Tue, 4 Jun 2019 04:41:23 +0000 (UTC) Date: Tue, 04 Jun 2019 04:41:23 +0000 To: "commits@olingo.apache.org" Subject: [olingo-odata2] branch master updated: [OLINGO-1362] Handling status code 420 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155962328385.30812.7833361293633653018@gitbox.apache.org> From: ramyav@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: olingo-odata2 X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: a941f16db247d3988d6e94f4a9c8775ccb4f0884 X-Git-Newrev: 8449e389b6166bd9a38473a599d8c7be91c31c20 X-Git-Rev: 8449e389b6166bd9a38473a599d8c7be91c31c20 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 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()); + } }