You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/10/23 07:43:42 UTC

[camel] branch master updated (cb6f376 -> 96eacfc)

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

acosentino pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from cb6f376  Camel-Jetty: Fixed CS
     new 8279a11  Camel-Servlet: Fixed tests
     new 96eacfc  Camel-Servlet: Fixed CS

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../ServletSetExchangePropertyBeanTest.java        |  2 +-
 .../servlet/ServletSwitchingStatusCode204Test.java | 57 +++++++++-------------
 .../servlet/rest/RestServletVerbTest.java          |  2 +-
 3 files changed, 25 insertions(+), 36 deletions(-)


[camel] 02/02: Camel-Servlet: Fixed CS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 96eacfc5d237c211293d6fa2eaef20f615580f39
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Oct 23 09:43:12 2019 +0200

    Camel-Servlet: Fixed CS
---
 .../servlet/ServletSwitchingStatusCode204Test.java | 57 +++++++++-------------
 1 file changed, 23 insertions(+), 34 deletions(-)

diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletSwitchingStatusCode204Test.java b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletSwitchingStatusCode204Test.java
index c6c64a8..2ae27ed 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletSwitchingStatusCode204Test.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletSwitchingStatusCode204Test.java
@@ -16,44 +16,37 @@
  */
 package org.apache.camel.component.servlet;
 
-import org.apache.camel.Exchange;
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.apache.http.client.methods.HttpGet;
-import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.impl.client.HttpClientBuilder;
-import org.apache.http.util.EntityUtils;
-import org.junit.Test;
-
 import com.meterware.httpunit.GetMethodWebRequest;
 import com.meterware.httpunit.WebRequest;
 import com.meterware.httpunit.WebResponse;
 import com.meterware.servletunit.ServletUnitClient;
 
-public class ServletSwitchingStatusCode204Test extends ServletCamelRouterTestSupport {
+import org.apache.camel.Exchange;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.Test;
 
+public class ServletSwitchingStatusCode204Test extends ServletCamelRouterTestSupport {
 
     @Test
     public void testSwitchingNoBodyTo204() throws Exception {
-    	 WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/bar");
-         ServletUnitClient client = newClient();
-         WebResponse response = client.getResponse(req);
-         
-         assertEquals(204, response.getResponseCode());
-         assertEquals("", response.getText());
+        WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/bar");
+        ServletUnitClient client = newClient();
+        WebResponse response = client.getResponse(req);
+
+        assertEquals(204, response.getResponseCode());
+        assertEquals("", response.getText());
     }
 
-   @Test
-   public void testNoSwitchingNoCode() throws Exception {
-       WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/foo");
-       ServletUnitClient client = newClient();
-       WebResponse response = client.getResponse(req);
+    @Test
+    public void testNoSwitchingNoCode() throws Exception {
+        WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/foo");
+        ServletUnitClient client = newClient();
+        WebResponse response = client.getResponse(req);
+
+        assertEquals(200, response.getResponseCode());
+        assertEquals("No Content", response.getText());
+    }
 
-       assertEquals(200, response.getResponseCode());
-       assertEquals("No Content", response.getText());
-   }
-	
     @Test
     public void testNoSwitchingNoBody() throws Exception {
         WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/foobar");
@@ -63,21 +56,17 @@ public class ServletSwitchingStatusCode204Test extends ServletCamelRouterTestSup
         assertEquals(200, response.getResponseCode());
         assertEquals("", response.getText());
     }
-    
+
     @Override
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             @Override
             public void configure() throws Exception {
-                from("servlet:/bar")
-                    .setBody().constant("");
+                from("servlet:/bar").setBody().constant("");
 
-                from("servlet:/foo")
-                    .setBody().constant("No Content");
+                from("servlet:/foo").setBody().constant("No Content");
 
-                from("servlet:/foobar")
-                    .setHeader(Exchange.HTTP_RESPONSE_CODE, constant(200))
-                    .setBody().constant("");
+                from("servlet:/foobar").setHeader(Exchange.HTTP_RESPONSE_CODE, constant(200)).setBody().constant("");
 
             }
         };


[camel] 01/02: Camel-Servlet: Fixed tests

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 8279a11bc11190c8cbe111971caceb95549171da
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Wed Oct 23 09:39:01 2019 +0200

    Camel-Servlet: Fixed tests
---
 .../camel/component/servlet/ServletSetExchangePropertyBeanTest.java     | 2 +-
 .../org/apache/camel/component/servlet/rest/RestServletVerbTest.java    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletSetExchangePropertyBeanTest.java b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletSetExchangePropertyBeanTest.java
index 926c0e6..61d972b 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletSetExchangePropertyBeanTest.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletSetExchangePropertyBeanTest.java
@@ -32,7 +32,7 @@ public class ServletSetExchangePropertyBeanTest extends ServletCamelRouterTestSu
         ServletUnitClient client = newClient();
         WebResponse response = client.getResponse(req);
 
-        assertEquals(200, response.getResponseCode());
+        assertEquals(204, response.getResponseCode());
         assertEquals("The response message is wrong ", "", response.getText());
     }
     
diff --git a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletVerbTest.java b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletVerbTest.java
index d2a6756..36b188d 100644
--- a/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletVerbTest.java
+++ b/components/camel-servlet/src/test/java/org/apache/camel/component/servlet/rest/RestServletVerbTest.java
@@ -108,7 +108,7 @@ public class RestServletVerbTest extends ServletCamelRouterTestSupport {
         client.setExceptionsThrownOnErrorStatus(false);
         WebResponse response = client.getResponse(req);
 
-        assertEquals(200, response.getResponseCode());
+        assertEquals(204, response.getResponseCode());
 
         assertMockEndpointsSatisfied();
     }