forked from junit-team/junit4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With ExpectedException, document that there should be no statements a…
…fter the exceptional one. (junit-team#1199) * Add text to the documentation of ExpectedException that points out that it is a mistake to have statements after the one that is expected to throw the exception. A common bug pattern is to have verification statements after that statement, like Mockito.verifyNoMoreInteractions. These will of course never be executed, but an imperfect understanding of exactly how ExpectedException works leads people not to realize that. * In ExpectedException, recommend the use of Assert.assertThrows. * In new ExpectedException javadoc text, spell out {@link} tags with complete parameter lists, and remove parentheses around the reference to expectThrows. Also move each <p> to the start of its paragraph text rather than a line on its own. * Refine the suggestion to use Assert.assertThrows, saying that it applies starting with Java 8.
- Loading branch information
1 parent
756959c
commit 61f8c83
Showing
1 changed file
with
20 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters