[GitHub] [camel] jono-morris commented on a diff in pull request #11449: CAMEL-17173 Mute server errors by default

2023-09-18 Thread via GitHub


jono-morris commented on code in PR #11449:
URL: https://github.com/apache/camel/pull/11449#discussion_r1328808694


##
components/camel-servlet/src/test/java/org/apache/camel/component/servlet/ServletMuteExceptionTest.java:
##
@@ -25,6 +25,18 @@
 
 public class ServletMuteExceptionTest extends ServletCamelRouterTestSupport {
 
+@Test
+public void testMuteDefaultTrue() throws Exception {
+WebRequest req = new PostMethodWebRequest(
+contextUrl + "/services/muteDefault",
+new ByteArrayInputStream("".getBytes()), "text/plain");
+WebResponse response = query(req, false);
+
+assertEquals(500, response.getResponseCode());
+assertEquals("text/plain", response.getContentType());
+assertEquals("", response.getText());

Review Comment:
   Done, thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



[GitHub] [camel] jono-morris commented on a diff in pull request #11449: CAMEL-17173 Mute server errors by default

2023-09-18 Thread via GitHub


jono-morris commented on code in PR #11449:
URL: https://github.com/apache/camel/pull/11449#discussion_r1328808389


##
components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyMuteExceptionTest.java:
##
@@ -41,13 +41,29 @@ public void testMuteException() throws Exception {
 }
 }
 
+@Test
+public void testDefaultMuteException() throws Exception {
+HttpGet get = new HttpGet("http://localhost:; + getPort() + 
"/fooDefault");
+get.addHeader("Accept", "application/text");
+try (CloseableHttpClient client = HttpClients.createDefault();
+ CloseableHttpResponse response = client.execute(get)) {
+
+String responseString = EntityUtils.toString(response.getEntity(), 
"UTF-8");
+assertEquals("", responseString);

Review Comment:
   Done, thanks for that.



##
components/camel-jetty/src/test/java/org/apache/camel/component/jetty/JettyMuteExceptionTest.java:
##
@@ -41,13 +41,29 @@ public void testMuteException() throws Exception {
 }
 }
 
+@Test
+public void testDefaultMuteException() throws Exception {
+HttpGet get = new HttpGet("http://localhost:; + getPort() + 
"/fooDefault");
+get.addHeader("Accept", "application/text");
+try (CloseableHttpClient client = HttpClients.createDefault();
+ CloseableHttpResponse response = client.execute(get)) {
+
+String responseString = EntityUtils.toString(response.getEntity(), 
"UTF-8");

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org