mureinik commented on code in PR #4484:
URL: https://github.com/apache/eventmesh/pull/4484#discussion_r1358353940
##########
eventmesh-runtime/src/test/java/org/apache/eventmesh/runtime/admin/controller/ClientManageControllerTest.java:
##########
@@ -85,13 +85,8 @@ public void testStart() throws Exception {
try (MockedStatic<HttpServer> dummyStatic =
Mockito.mockStatic(HttpServer.class)) {
HttpServer server = mock(HttpServer.class);
dummyStatic.when(() -> HttpServer.create(any(),
anyInt())).thenReturn(server);
- try {
- Mockito.doNothing().when(adminController).run(server);
- controller.start();
- } catch (IOException e) {
- Assertions.fail(e.getMessage());
- }
-
+ Mockito.doNothing().when(adminController).run(server);
+ controller.start();
Review Comment:
This was definitely the intention of the original test.
Effectively, even without it the test has the same functionality (if an
exception is thrown out of the test method it doesn't pass), but I agree that
using `assertDoesNotThrow` would be more explicit.
I'll amend the PR accordingly.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]