orpiske commented on code in PR #11449:
URL: https://github.com/apache/camel/pull/11449#discussion_r1328717403


##########
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:
   Maybe use `assertTrue(responseString.isEmpty())` ?



##########
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:
   Use `StandardCharsets.UTF_8` 
   
   Obs.: I know the other test in there uses "UTF-8" (this is an old practice - 
we still have a few places doing this).



##########
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:
   Same note I raised on another text.



-- 
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

Reply via email to