orpiske commented on code in PR #10804:
URL: https://github.com/apache/camel/pull/10804#discussion_r1272226759
##########
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:
To be even more correct, with regards to the `run` especification, the test
code should do something like this:
```
final int ret = Assertions.assertDoesNotThrow(() -> my.run(new String[] {
"-h" }));
Assertions.assertEquals(0, ret, "The code should return 0 when -h is
requested");
```
That ensures that:
1. Proper distinction between errors and failures
2. That the correct return code (0 - or something else, if that's the
expectation) is returned when a valid options is passed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]