Skip to content

Commit f82d93f

Browse files
pbodnarsbrannen
authored andcommitted
Document replacement for @test(expected=...) in JUnit 4 migration tips
Closes #3348
1 parent eb34ed7 commit f82d93f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

documentation/src/docs/asciidoc/user-guide/migration-from-junit4.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ tests to JUnit Jupiter.
6363
* `@Rule` and `@ClassRule` no longer exist; superseded by `@ExtendWith` and
6464
`@RegisterExtension`.
6565
- See also <<migrating-from-junit4-rule-support>>.
66+
* `@Test(expected = ...)` and the `ExpectedException` rule no longer exist; use
67+
`Assertions.assertThrows(...)` instead.
68+
See <<migrating-from-junit4-rule-support>> if you still do need to use
69+
`ExpectedException`.
6670
* Assertions and assumptions in JUnit Jupiter accept the failure message as their last
6771
argument instead of the first one.
6872
- See <<migrating-from-junit4-failure-message-arguments>> for details.

0 commit comments

Comments
 (0)