wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r1003149 - in /incubator/wink/trunk: wink-client/src/main/java/org/apache/wink/client/internal/ wink-client/src/test/java/org/apache/wink/client/ wink-component-test-support/src/main/java/org/apache/wink/client/
Date Thu, 30 Sep 2010 16:44:25 GMT
Author: bluk
Date: Thu Sep 30 16:44:24 2010
New Revision: 1003149

URL: http://svn.apache.org/viewvc?rev=1003149&view=rev
Log:
Fix the Resource.header() to follow JavaDoc

Invoking the method would eventually create
multiple headers with separate values
instead of a "," concatenated value.

Modified:
    incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/ResourceImpl.java
    incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/ClientTest.java
    incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/HandlersTest.java
    incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/client/MockHttpServer.java

Modified: incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/ResourceImpl.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/ResourceImpl.java?rev=1003149&r1=1003148&r2=1003149&view=diff
==============================================================================
--- incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/ResourceImpl.java
(original)
+++ incubator/wink/trunk/wink-client/src/main/java/org/apache/wink/client/internal/ResourceImpl.java
Thu Sep 30 16:44:24 2010
@@ -123,11 +123,21 @@ public class ResourceImpl implements Res
         if (name == null) {
             return this;
         }
+        StringBuilder finalHeaderValue = new StringBuilder();
+        boolean isFirstHeader = true;
         for (String value : values) {
-            if (value != null) {
-                headers.add(name, value);
+            if (value != null && value.trim().length() != 0) {
+                if (!isFirstHeader) {
+                    finalHeaderValue.append(", ");
+                } else {
+                    isFirstHeader = false;
+                }
+                finalHeaderValue.append(value);
             }
         }
+        if (finalHeaderValue.length() > 0) {
+            headers.add(name, finalHeaderValue.toString());
+        }
         return this;
     }
 
@@ -256,7 +266,7 @@ public class ResourceImpl implements Res
         request.getAttributes().putAll(attributes);
         request.setAttribute(ProvidersRegistry.class, providersRegistry);
         request.setAttribute(WinkConfiguration.class, config);
-        request.setAttribute(ClientConfig.class, config);  // legacy
+        request.setAttribute(ClientConfig.class, config); // legacy
         request.getAttributes().put(ClientRequestImpl.RESPONSE_ENTITY_GENERIC_TYPE,
                                     responseEntityType);
         request.getAttributes().put(ClientRequestImpl.RESPONSE_ENTITY_CLASS_TYPE, responseEntity);

Modified: incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/ClientTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/ClientTest.java?rev=1003149&r1=1003148&r2=1003149&view=diff
==============================================================================
--- incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/ClientTest.java
(original)
+++ incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/ClientTest.java
Thu Sep 30 16:44:24 2010
@@ -27,8 +27,8 @@ import java.lang.annotation.Annotation;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
 import java.text.MessageFormat;
-import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 import java.util.logging.LogRecord;
 
@@ -36,7 +36,6 @@ import javax.ws.rs.WebApplicationExcepti
 import javax.ws.rs.core.Application;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response.Status.Family;
 import javax.ws.rs.ext.MessageBodyReader;
 import javax.ws.rs.ext.MessageBodyWriter;
 import javax.ws.rs.ext.Provider;
@@ -61,7 +60,6 @@ public class ClientTest extends BaseTest
             this.t = t;
         }
     }
-    
 
     @Provider
     public static class TestGenericsProvider implements MessageBodyWriter<TestGenerics<String>>,
@@ -135,7 +133,8 @@ public class ClientTest extends BaseTest
     public void testRestClientURIEncoded() throws Exception {
         WinkLogHandler.turnLoggingCaptureOn(WinkLogHandler.LEVEL.TRACE);
         RestClient client = getRestClient();
-        // I just want to see that the URI got encoded, I don't care if the actual query
succeeds; so I'm going to check the logs.
+        // I just want to see that the URI got encoded, I don't care if the
+        // actual query succeeds; so I'm going to check the logs.
         Resource resource = client.resource(serviceURL + "/some space", true);
         try {
             ClientResponse response = resource.get();
@@ -143,11 +142,12 @@ public class ClientTest extends BaseTest
             e.printStackTrace();
         }
         WinkLogHandler.turnLoggingCaptureOff();
-        ArrayList<LogRecord> logRecords = WinkLogHandler.getRecords();
+        List<LogRecord> logRecords = WinkLogHandler.getRecords();
         boolean found = false;
-        for(int i = 0; i < logRecords.size(); i++) {
+        for (int i = 0; i < logRecords.size(); i++) {
             if (logRecords.get(i).getMessage().contains("client issued a request")) {
-                if (logRecords.get(i).getMessage().contains(" http://localhost:34568/some/service/some%20space
")) {
+                if (logRecords.get(i).getMessage()
+                    .contains(" http://localhost:34568/some/service/some%20space ")) {
                     found = true;
                 }
             }
@@ -155,7 +155,7 @@ public class ClientTest extends BaseTest
         assertTrue("A log record should have contained the encoded URI", found);
         WinkLogHandler.clearRecords();
     }
-    
+
     public void testRestClientURINotEncoded() throws Exception {
         RestClient client = getRestClient();
         // I just want to see that the URI got rejected due to the whitespace
@@ -165,7 +165,7 @@ public class ClientTest extends BaseTest
         } catch (IllegalArgumentException e) {
         }
     }
-    
+
     public void testResourceGet() {
         MockHttpServerResponse response1 = new MockHttpServerResponse();
         response1.setMockResponseCode(200);
@@ -188,9 +188,6 @@ public class ClientTest extends BaseTest
         TestGenerics<String> tg = resource.get(new EntityType<TestGenerics<String>>()
{
         });
         assertEquals(RECEIVED_MESSAGE, tg.getT());
-        assertEquals(200, clientResponse.getStatusType().getStatusCode());
-        assertEquals(Family.SUCCESSFUL, clientResponse.getStatusType().getFamily());
-        assertEquals("OK", clientResponse.getStatusType().getReasonPhrase());
     }
 
     public void testResourcePut() throws IOException {
@@ -217,9 +214,6 @@ public class ClientTest extends BaseTest
         }, SENT_MESSAGE);
         assertEquals(RECEIVED_MESSAGE, tg.getT());
 
-        assertEquals(200, clientResponse.getStatusType().getStatusCode());
-        assertEquals(Family.SUCCESSFUL, clientResponse.getStatusType().getFamily());
-        assertEquals("OK", clientResponse.getStatusType().getReasonPhrase());
     }
 
     public void testResourcePost() throws IOException {
@@ -246,10 +240,6 @@ public class ClientTest extends BaseTest
         TestGenerics<String> tg = resource.post(new EntityType<TestGenerics<String>>()
{
         }, SENT_MESSAGE);
         assertEquals(RECEIVED_MESSAGE, tg.getT());
-
-        assertEquals(200, clientResponse.getStatusType().getStatusCode());
-        assertEquals(Family.SUCCESSFUL, clientResponse.getStatusType().getFamily());
-        assertEquals("OK", clientResponse.getStatusType().getReasonPhrase());
     }
 
     public void testResourceDelete() {
@@ -273,10 +263,6 @@ public class ClientTest extends BaseTest
         TestGenerics<String> tg = resource.delete(new EntityType<TestGenerics<String>>()
{
         });
         assertEquals(RECEIVED_MESSAGE, tg.getT());
-
-        assertEquals(200, clientResponse.getStatusType().getStatusCode());
-        assertEquals(Family.SUCCESSFUL, clientResponse.getStatusType().getFamily());
-        assertEquals("OK", clientResponse.getStatusType().getReasonPhrase());
     }
 
     public void testInvoke() {
@@ -316,10 +302,6 @@ public class ClientTest extends BaseTest
         try {
             ClientResponse res = resource.accept("text/plain").get();
             assertTrue(res.getStatusCode() == 400);
-
-            assertEquals(400, res.getStatusType().getStatusCode());
-            assertEquals(Family.CLIENT_ERROR, res.getStatusType().getFamily());
-            assertEquals("Bad Request", res.getStatusType().getReasonPhrase());
         } catch (Exception e) {
             fail("Exception must not be thrown");
         }
@@ -329,8 +311,10 @@ public class ClientTest extends BaseTest
 
         MockHttpServer server = new MockHttpServer(34567);
         server.getMockHttpServerResponses().get(0).setMockResponseCode(200);
-        server.getMockHttpServerResponses().get(0).setMockResponseContent("REQUEST".getBytes("UTF-16"));
-        server.getMockHttpServerResponses().get(0).setMockResponseContentType("text/plain;
charset=UTF-16");
+        server.getMockHttpServerResponses().get(0).setMockResponseContent("REQUEST"
+            .getBytes("UTF-16"));
+        server.getMockHttpServerResponses().get(0)
+            .setMockResponseContentType("text/plain; charset=UTF-16");
 
         server.startServer();
         try {
@@ -349,7 +333,8 @@ public class ClientTest extends BaseTest
     public void testResponseEmptyContentType() throws IOException {
         MockHttpServer server = new MockHttpServer(34567);
         server.getMockHttpServerResponses().get(0).setMockResponseCode(200);
-        server.getMockHttpServerResponses().get(0).setMockResponseContent("REQUEST".getBytes("UTF-8"));
+        server.getMockHttpServerResponses().get(0).setMockResponseContent("REQUEST"
+            .getBytes("UTF-8"));
         server.getMockHttpServerResponses().get(0).setMockResponseContentType("");
 
         server.startServer();
@@ -364,5 +349,54 @@ public class ClientTest extends BaseTest
             server.stopServer();
         }
     }
-    
+
+    public void testHeadersConcat() throws IOException {
+        MockHttpServer server = new MockHttpServer(34567);
+
+        MockHttpServerResponse response1 = new MockHttpServerResponse();
+        response1.setMockResponseCode(200);
+        MockHttpServerResponse response2 = new MockHttpServerResponse();
+        response2.setMockResponseCode(200);
+        MockHttpServerResponse response3 = new MockHttpServerResponse();
+        response3.setMockResponseCode(200);
+        MockHttpServerResponse response4 = new MockHttpServerResponse();
+        response4.setMockResponseCode(200);
+
+        server.setMockHttpServerResponses(response1, response2, response3, response4);
+
+        server.startServer();
+        // single
+        try {
+            RestClient client = getRestClient();
+            Resource resource =
+                client.resource(MessageFormat.format(SERVICE_URL, String.valueOf(server
+                    .getServerPort()))).header("customHeader1", "abcd");
+            resource.accept(MediaType.TEXT_PLAIN_TYPE).get(String.class);
+            assertEquals(server.getRequestHeaders().get("customHeader1").get(0), "abcd");
+
+            resource =
+                client.resource(MessageFormat.format(SERVICE_URL, String.valueOf(server
+                    .getServerPort()))).header("customHeader1", "abcd", "lmnop");
+            resource.accept(MediaType.TEXT_PLAIN_TYPE).get(String.class);
+            assertEquals("abcd, lmnop", server.getRequestHeaders().get("customHeader1").get(0));
+
+            resource =
+                client.resource(MessageFormat.format(SERVICE_URL, String.valueOf(server
+                    .getServerPort()))).header("customHeader1", "abcd", "lmnop", "xyz");
+            resource.accept(MediaType.TEXT_PLAIN_TYPE).get(String.class);
+            assertEquals(server.getRequestHeaders().get("customHeader1").get(0), "abcd, lmnop,
xyz");
+
+            resource =
+                client.resource(MessageFormat.format(SERVICE_URL, String.valueOf(server
+                    .getServerPort()))).header("customHeader1", "   ", "lmnop", "xyz")
+                    .header("customHeader1", "customValue1");
+            resource.accept(MediaType.TEXT_PLAIN_TYPE).get(String.class);
+            assertEquals(server.getRequestHeaders().get("customHeader1").get(0), "lmnop,
xyz");
+            assertEquals(server.getRequestHeaders().get("customHeader1").get(1), "customValue1");
+        } finally {
+            server.stopServer();
+        }
+        server.getMockHttpServerResponses().clear();
+    }
+
 }

Modified: incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/HandlersTest.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/HandlersTest.java?rev=1003149&r1=1003148&r2=1003149&view=diff
==============================================================================
--- incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/HandlersTest.java
(original)
+++ incubator/wink/trunk/wink-client/src/test/java/org/apache/wink/client/HandlersTest.java
Thu Sep 30 16:44:24 2010
@@ -56,7 +56,7 @@ public class HandlersTest extends BaseTe
         assertEquals(SENT_MESSAGE.toLowerCase(), response.getEntity(String.class));
 
         // Check that handler added Http header
-        assertTrue(server.getRequestHeaders().get(DUMMY_REQUEST_HEADER)
+        assertTrue(server.getRequestHeaders().get(DUMMY_REQUEST_HEADER).get(0)
             .equalsIgnoreCase(DUMMY_REQUEST_VALUE));
         assertTrue(response.getHeaders().get(DUMMY_RESPONSE_HEADER).get(0)
             .equalsIgnoreCase(DUMMY_RESPONSE_VALUE));

Modified: incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/client/MockHttpServer.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/client/MockHttpServer.java?rev=1003149&r1=1003148&r2=1003149&view=diff
==============================================================================
--- incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/client/MockHttpServer.java
(original)
+++ incubator/wink/trunk/wink-component-test-support/src/main/java/org/apache/wink/client/MockHttpServer.java
Thu Sep 30 16:44:24 2010
@@ -37,6 +37,7 @@ import java.util.Map;
 
 import javax.net.ServerSocketFactory;
 import javax.net.ssl.SSLServerSocketFactory;
+import javax.ws.rs.core.MultivaluedMap;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 
@@ -45,12 +46,12 @@ public class MockHttpServer extends Thre
     public static class MockHttpServerResponse {
 
         // mock response data
-        private int                   mockResponseCode        = 200;
-        private Map<String, String>   mockResponseHeaders     = new HashMap<String,
String>();
-        private byte[]                mockResponseContent     = BaseTest.RECEIVED_MESSAGE.getBytes();
-        private String                mockResponseContentType = "text/plain;charset=utf-8";
-        private boolean               mockResponseContentEchoRequest;
-        
+        private int                 mockResponseCode        = 200;
+        private Map<String, String> mockResponseHeaders     = new HashMap<String,
String>();
+        private byte[]              mockResponseContent     = BaseTest.RECEIVED_MESSAGE.getBytes();
+        private String              mockResponseContentType = "text/plain;charset=utf-8";
+        private boolean             mockResponseContentEchoRequest;
+
         public void setMockResponseHeaders(Map<String, String> headers) {
             mockResponseHeaders.clear();
             mockResponseHeaders.putAll(headers);
@@ -59,7 +60,7 @@ public class MockHttpServer extends Thre
         public void setMockResponseHeader(String name, String value) {
             mockResponseHeaders.put(name, value);
         }
-        
+
         public Map<String, String> getMockResponseHeaders() {
             return mockResponseHeaders;
         }
@@ -67,7 +68,7 @@ public class MockHttpServer extends Thre
         public void setMockResponseCode(int responseCode) {
             this.mockResponseCode = responseCode;
         }
-        
+
         public int getMockResponseCode() {
             return mockResponseCode;
         }
@@ -79,7 +80,7 @@ public class MockHttpServer extends Thre
         public void setMockResponseContent(byte[] content) {
             mockResponseContent = content;
         }
-        
+
         public byte[] getMockResponseContent() {
             return mockResponseContent;
         }
@@ -87,7 +88,7 @@ public class MockHttpServer extends Thre
         public void setMockResponseContentType(String type) {
             mockResponseContentType = type;
         }
-        
+
         public String getMockResponseContentType() {
             return mockResponseContentType;
         }
@@ -95,35 +96,39 @@ public class MockHttpServer extends Thre
         public void setMockResponseContentEchoRequest(boolean echo) {
             mockResponseContentEchoRequest = echo;
         }
-        
+
         public boolean getMockResponseContentEchoRequest() {
             return mockResponseContentEchoRequest;
         }
     }
-    
-    private Thread                serverThread            = null;
-    private ServerSocket          serverSocket            = null;
-    private boolean               serverStarted           = false;
-    private ServerSocketFactory   serverSocketFactory     = null;
-    private int                   serverPort;
-    private int                   readTimeOut             = 5000;                       
 // 5
+
+    private Thread                       serverThread            = null;
+    private ServerSocket                 serverSocket            = null;
+    private boolean                      serverStarted           = false;
+    private ServerSocketFactory          serverSocketFactory     = null;
+    private int                          serverPort;
+    private int                          readTimeOut             = 5000;                
                    // 5
     // seconds
-    private int                   delayResponseTime       = 0;
-    private static byte[]         NEW_LINE                = "\r\n".getBytes();
+    private int                          delayResponseTime       = 0;
+    private static byte[]                NEW_LINE                = "\r\n".getBytes();
     // request data
-    private String                requestMethod           = null;
-    private String                requestUrl              = null;
-    private Map<String, String>   requestHeaders          = new HashMap<String,
String>();
-    private ByteArrayOutputStream requestContent          = new ByteArrayOutputStream();
-    private List<MockHttpServerResponse> mockHttpServerResponses = new ArrayList<MockHttpServerResponse>();
-    private int responseCounter = 0;
+    private String                       requestMethod           = null;
+    private String                       requestUrl              = null;
+    private Map<String, List<String>>    requestHeaders          =
+                                                                     new HashMap<String,
List<String>>();
+    private ByteArrayOutputStream        requestContent          = new ByteArrayOutputStream();
+    private List<MockHttpServerResponse> mockHttpServerResponses =
+                                                                     new ArrayList<MockHttpServerResponse>();
+    private int                          responseCounter         = 0;
 
     public MockHttpServer(int serverPort) {
         this(serverPort, false);
     }
 
     public MockHttpServer(int serverPort, boolean ssl) {
-        mockHttpServerResponses.add(new MockHttpServerResponse());  // set a default response
+        mockHttpServerResponses.add(new MockHttpServerResponse()); // set a
+        // default
+        // response
         this.serverPort = serverPort;
         try {
             serverSocketFactory = ServerSocketFactory.getDefault();
@@ -284,6 +289,7 @@ public class MockHttpServer extends Thre
         }
 
         private void processRequestHeaders(InputStream is) throws IOException {
+            requestHeaders.clear();
             byte[] line = null;
             while ((line = readLine(is)) != null) {
                 String lineStr = new String(line);
@@ -301,20 +307,28 @@ public class MockHttpServer extends Thre
                 return;
             }
 
-            if ("chunked".equals(requestHeaders.get("Transfer-Encoding"))) {
+            List<String> transferEncodingValues = requestHeaders.get("Transfer-Encoding");
+            String transferEncoding =
+                (transferEncodingValues == null || transferEncodingValues.isEmpty()) ? null
+                    : transferEncodingValues.get(0);
+            if ("chunked".equals(transferEncoding)) {
                 processChunkedContent(is);
             } else {
                 processRegularContent(is);
             }
-            
+
             if (mockHttpServerResponses.get(responseCounter).getMockResponseContentEchoRequest())
{
-                mockHttpServerResponses.get(responseCounter).setMockResponseContent(requestContent.toByteArray());
+                mockHttpServerResponses.get(responseCounter).setMockResponseContent(requestContent
+                    .toByteArray());
             }
 
         }
 
         private void processRegularContent(InputStream is) throws IOException {
-            String contentLength = requestHeaders.get("Content-Length");
+            List<String> contentLengthValues = requestHeaders.get("Content-Length");
+            String contentLength =
+                (contentLengthValues == null || contentLengthValues.isEmpty()) ? null
+                    : contentLengthValues.get(0);
             if (contentLength == null) {
                 return;
             }
@@ -404,7 +418,12 @@ public class MockHttpServer extends Thre
 
         private void addRequestHeader(String line) {
             String[] parts = line.split(": ");
-            requestHeaders.put(parts[0], parts[1]);
+            List<String> values = requestHeaders.get(parts[0]);
+            if (values == null) {
+                values = new ArrayList<String>();
+                requestHeaders.put(parts[0], values);
+            }
+            values.add(parts[1]);
         }
 
         private void processResponse(Socket socket) throws IOException {
@@ -416,11 +435,15 @@ public class MockHttpServer extends Thre
             OutputStream sos = socket.getOutputStream();
             BufferedOutputStream os = new BufferedOutputStream(sos);
             String reason = "";
-            Status statusCode = Response.Status.fromStatusCode(mockHttpServerResponses.get(responseCounter).getMockResponseCode());
+            Status statusCode =
+                Response.Status.fromStatusCode(mockHttpServerResponses.get(responseCounter)
+                    .getMockResponseCode());
             if (statusCode != null) {
                 reason = statusCode.toString();
             }
-            os.write(("HTTP/1.1 " + mockHttpServerResponses.get(responseCounter).getMockResponseCode()
+ " " + reason).getBytes());
+            os.write(("HTTP/1.1 " + mockHttpServerResponses.get(responseCounter)
+                .getMockResponseCode()
+                + " " + reason).getBytes());
             os.write(NEW_LINE);
             processResponseHeaders(os);
             processResponseContent(os);
@@ -454,17 +477,22 @@ public class MockHttpServer extends Thre
 
         private void processResponseHeaders(OutputStream os) throws IOException {
             addServerResponseHeaders();
-            for (String header : mockHttpServerResponses.get(responseCounter).getMockResponseHeaders().keySet())
{
-                os.write((header + ": " + mockHttpServerResponses.get(responseCounter).getMockResponseHeaders().get(header)).getBytes());
+            for (String header : mockHttpServerResponses.get(responseCounter)
+                .getMockResponseHeaders().keySet()) {
+                os.write((header + ": " + mockHttpServerResponses.get(responseCounter)
+                    .getMockResponseHeaders().get(header)).getBytes());
                 os.write(NEW_LINE);
             }
             os.write(NEW_LINE);
         }
 
         private void addServerResponseHeaders() {
-            Map<String, String> mockResponseHeaders = mockHttpServerResponses.get(responseCounter).getMockResponseHeaders();
-            mockResponseHeaders.put("Content-Type", mockHttpServerResponses.get(responseCounter).getMockResponseContentType());
-            mockResponseHeaders.put("Content-Length", mockHttpServerResponses.get(responseCounter).getMockResponseContent().length
+ "");
+            Map<String, String> mockResponseHeaders =
+                mockHttpServerResponses.get(responseCounter).getMockResponseHeaders();
+            mockResponseHeaders.put("Content-Type", mockHttpServerResponses.get(responseCounter)
+                .getMockResponseContentType());
+            mockResponseHeaders.put("Content-Length", mockHttpServerResponses.get(responseCounter)
+                .getMockResponseContent().length + "");
             mockResponseHeaders.put("Server", "Mock HTTP Server v1.0");
             mockResponseHeaders.put("Connection", "closed");
         }
@@ -486,7 +514,7 @@ public class MockHttpServer extends Thre
         return requestContent.toByteArray();
     }
 
-    public Map<String, String> getRequestHeaders() {
+    public Map<String, List<String>> getRequestHeaders() {
         return requestHeaders;
     }
 
@@ -559,10 +587,10 @@ public class MockHttpServer extends Thre
             }
         }
     }
-    
+
     public void setMockHttpServerResponses(MockHttpServerResponse... responses) {
         mockHttpServerResponses.clear();
-        for(int i = 0;i < responses.length; i++) {
+        for (int i = 0; i < responses.length; i++) {
             mockHttpServerResponses.add(responses[i]);
         }
     }



Mime
View raw message