Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document @MethodSource as use case for @TestInstance per-class lifecycle #3219

Merged
merged 2 commits into from
Apr 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions documentation/src/docs/asciidoc/user-guide/writing-tests.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,8 @@ NOTE: Beginning with Java 16, `@BeforeAll` and `@AfterAll` methods can be declar
`static` in `@Nested` test classes.

If you are authoring tests using the Kotlin programming language, you may also find it
easier to implement `@BeforeAll` and `@AfterAll` methods by switching to the "per-class"
test instance lifecycle mode.
easier to implement `@BeforeAll` and `@AfterAll` methods and also factory methods for
`@MethodSource` by switching to the "per-class" test instance lifecycle mode.

[[writing-tests-test-instance-lifecycle-changing-default]]
==== Changing the Default Test Instance Lifecycle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
* <li>Declaration of {@code @BeforeAll} and {@code @AfterAll} on interface
* {@code default} methods.</li>
* <li>Simplified declaration of non-static {@code @BeforeAll} and {@code @AfterAll}
* methods in test classes implemented with the Kotlin programming language.</li>
* methods and also factory methods for {@code @MethodSource} in test classes
* implemented with the Kotlin programming language.</li>
* </ul>
*
* <p>{@code @TestInstance} may also be used as a meta-annotation in order to
Expand Down