You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by an...@apache.org on 2020/06/11 18:25:21 UTC

[sling-org-apache-sling-servlet-helpers] branch master updated: Add two tests dealing with checking the response status code after checking the status code

This is an automated email from the ASF dual-hosted git repository.

andysch pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlet-helpers.git


The following commit(s) were added to refs/heads/master by this push:
     new 304adcf  Add two tests dealing with checking the response status code after checking the status code
304adcf is described below

commit 304adcf716bf733fe4af5de97a163d14a8d0aef2
Author: Andreas Schaefer <sc...@iMac.local>
AuthorDate: Thu Jun 11 11:25:05 2020 -0700

    Add two tests dealing with checking the response status code after checking the status code
---
 .../internalrequests/ServletInternalRequestTest.java          | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/test/java/org/apache/sling/servlethelpers/internalrequests/ServletInternalRequestTest.java b/src/test/java/org/apache/sling/servlethelpers/internalrequests/ServletInternalRequestTest.java
index cb36d4f..15abcea 100644
--- a/src/test/java/org/apache/sling/servlethelpers/internalrequests/ServletInternalRequestTest.java
+++ b/src/test/java/org/apache/sling/servlethelpers/internalrequests/ServletInternalRequestTest.java
@@ -229,4 +229,15 @@ public class ServletInternalRequestTest {
         request("/noservlet").withResourceType("NOSERVLET").execute().checkStatus(HttpServletResponse.SC_NOT_FOUND);
     }
 
+    @Test
+    public void checkStatusCodeReturn() throws IOException {
+        InternalRequest call = request("/noservlet").withResourceType("NOSERVLET").execute().checkStatus(HttpServletResponse.SC_NOT_FOUND);
+        assertEquals("Unexpected Status Code", HttpServletResponse.SC_NOT_FOUND, call.getStatus());
+    }
+
+    @Test
+    public void checkMultipleStatusCodeReturn() throws IOException {
+        InternalRequest call = request("/response").execute().checkStatus(HttpServletResponse.SC_OK, HttpServletResponse.SC_NOT_FOUND);
+        assertEquals("Unexpected Status Code", HttpServletResponse.SC_OK, call.getStatus());
+    }
 }
\ No newline at end of file