sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [sling-org-apache-sling-servlet-helpers] branch master updated: SLING-7657 allows the responseContentType to be set
Date Mon, 07 May 2018 19:38:56 GMT
This is an automated email from the ASF dual-hosted git repository.

jeb 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 2d991de  SLING-7657 allows the responseContentType to be set
2d991de is described below

commit 2d991de38684ffec35788167fd61617dd9eb1dac
Author: JE Bailey <jeb@apache.org>
AuthorDate: Mon May 7 15:38:52 2018 -0400

    SLING-7657 allows the responseContentType to be set
---
 .../sling/servlethelpers/MockSlingHttpServletRequest.java     | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
b/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
index ac64f9a..4b60195 100644
--- a/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
+++ b/src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java
@@ -33,6 +33,7 @@ import java.security.Principal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -107,6 +108,7 @@ public class MockSlingHttpServletRequest extends SlingAdaptable implements
Sling
     private boolean getReaderCalled;
 
     private MockRequestDispatcherFactory requestDispatcherFactory;
+	private String responseContentType;
     
     protected static final ResourceBundle EMPTY_RESOURCE_BUNDLE = new ListResourceBundle()
{
         @Override
@@ -753,12 +755,17 @@ public class MockSlingHttpServletRequest extends SlingAdaptable implements
Sling
 
     @Override
     public String getResponseContentType() {
-        throw new UnsupportedOperationException();
+        return responseContentType;
+    }
+    
+    public void setResponseContentType(String responseContentType) {
+        this.responseContentType = responseContentType;
     }
 
+
     @Override
     public Enumeration<String> getResponseContentTypes() {
-        throw new UnsupportedOperationException();
+        return Collections.enumeration(Collections.singleton(responseContentType));
     }
 
     @Override

-- 
To stop receiving notification emails like this one, please contact
jeb@apache.org.

Mime
View raw message