Skip to content

Commit 0dcbc71

Browse files
committed
Update Javadoc for TestInstancePreDestroyCallback regarding scope
1 parent e5985c0 commit 0dcbc71

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@
2323
* the test instance, invoking custom clean-up methods on the test instance, etc.
2424
*
2525
* <p>Extensions that implement {@code TestInstancePreDestroyCallback} must be
26-
* registered at the class level.
26+
* registered at the class level if the test class is configured with
27+
* {@link org.junit.jupiter.api.TestInstance.Lifecycle @TestInstance(Lifecycle.PER_CLASS)}
28+
* semantics. If the test class is configured with
29+
* {@link org.junit.jupiter.api.TestInstance.Lifecycle @TestInstance(Lifecycle.PER_METHOD)}
30+
* semantics, {@code TestInstancePreDestroyCallback} extensions may be registered
31+
* at the class level or at the method level. In the latter case, the
32+
* {@code TestInstancePreDestroyCallback} extension will only be applied to the
33+
* test method for which it is registered.
2734
*
2835
* <h3>Constructor Requirements</h3>
2936
*

0 commit comments

Comments
 (0)