mureinik opened a new pull request, #4484:
URL: https://github.com/apache/eventmesh/pull/4484
<!--
### Contribution Checklist
- Name the pull request in the form "[ISSUE #XXXX] Title of the pull
request",
where *XXXX* should be replaced by the actual issue number.
Skip *[ISSUE #XXXX]* if there is no associated github issue for this
pull request.
- Fill out the template below to describe the changes contributed by the
pull request.
That will give reviewers the context they need to do the review.
- Each pull request should address only one issue.
Please do not mix up code from multiple issues.
- Each commit in the pull request should have a meaningful commit message.
- Once all items of the checklist are addressed, remove the above text and
this checklist,
leaving only the filled out template below.
(The sections below can be removed for hotfixes of typos)
-->
<!--
(If this PR fixes a GitHub issue, please add `Fixes #<XXX>` or `Closes
#<XXX>`.)
-->
Fixes #4483.
### Motivation
Following 750825158253d4004e023cfb8ab515c39bc20a71 (#4475), the upgrade to
JUnit Jupiter allows us to standardize the way exceptions are handled in tests
and reduce boilerplate code.
### Modifications
- There is no need to catch an exception and explicitly fail the test. The
test should be allowed to throw the exception and error-out, which is
technically the correct behavior (the test didn't really fail on any logic
test).
- In the cases where the only assertion was a call to `Assertions.fail` in
the `catch` block, a clarifying comment was added to explain why the test has
no explicit assertions.
- In order to test cases when an exception must be thrown,
`Assertions.assertThrows` can be used. There is no need to catch the exception
and assert it's not null.
- It's also worth noting that some instances that used the idiom of
catching an expected exception did not fail the test in case the exception was
never thrown, meaning this patch not only improves the tests' style, but also
their correctness.
### Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
- If a feature is not applicable for documentation, explain why?
- If a feature is not documented yet in this PR, please create a followup
issue for adding the documentation
--
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]