diff --git a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java index be9c81e8e7c2..c7f670d57f3d 100644 --- a/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java +++ b/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/TestInstancePreDestroyCallback.java @@ -23,7 +23,14 @@ * the test instance, invoking custom clean-up methods on the test instance, etc. * *

Extensions that implement {@code TestInstancePreDestroyCallback} must be - * registered at the class level. + * registered at the class level if the test class is configured with + * {@link org.junit.jupiter.api.TestInstance.Lifecycle @TestInstance(Lifecycle.PER_CLASS)} + * semantics. If the test class is configured with + * {@link org.junit.jupiter.api.TestInstance.Lifecycle @TestInstance(Lifecycle.PER_METHOD)} + * semantics, {@code TestInstancePreDestroyCallback} extensions may be registered + * at the class level or at the method level. In the latter case, the + * {@code TestInstancePreDestroyCallback} extension will only be applied to the + * test method for which it is registered. * *

Constructor Requirements

*