You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "orpiske (via GitHub)" <gi...@apache.org> on 2023/07/24 12:49:55 UTC

[GitHub] [camel] orpiske commented on a diff in pull request #10804: Camel 19557

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


##########
core/camel-main/src/test/java/org/apache/camel/main/MainSupportCommandLineTest.java:
##########
@@ -44,20 +45,20 @@ public CamelContext getCamelContext() {
     }
 
     @Test
-    public void testMainSupport() throws Exception {
+    public void testMainSupport() {
         MyMainSupport my = new MyMainSupport();
-        my.run(new String[] { "-d", "1" });
+        Assertions.assertDoesNotThrow(() -> my.run(new String[] { "-d", "1" }));

Review Comment:
   Actually, the proposed change is right.
   
   In the case `my.run` throws an exception, that gets recorded as a test error not as a test failure. A test without assertions is not really testing anything (or, just, doing half of the job). 



##########
core/camel-main/src/test/java/org/apache/camel/main/MainSupportCommandLineTest.java:
##########
@@ -44,20 +45,20 @@ public CamelContext getCamelContext() {
     }
 
     @Test
-    public void testMainSupport() throws Exception {
+    public void testMainSupport() {
         MyMainSupport my = new MyMainSupport();
-        my.run(new String[] { "-d", "1" });
+        Assertions.assertDoesNotThrow(() -> my.run(new String[] { "-d", "1" }));

Review Comment:
   Actually, the proposed change is correct.
   
   In the case `my.run` throws an exception, that gets recorded as a test error not as a test failure. A test without assertions is not really testing anything (or, just, doing half of the job). 



-- 
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-unsubscribe@camel.apache.org

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