- All Superinterfaces:
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface @API(status=EXPERIMENTAL, since="5.6") public interface TestInstancePreDestroyCallback extends Extension
TestInstancePreDestroyCallbackdefines the API for
Extensionsthat wish to process test instances after they have been used in tests but before they are destroyed.
Common use cases include releasing resources that have been created for the test instance, invoking custom clean-up methods on the test instance, etc.
Extensions that implement
TestInstancePreDestroyCallbackmust be registered at the class level.
Consult the documentation in
Extensionfor details on constructor requirements.
void preDestroyTestInstance(ExtensionContext context) throws ExceptionCallback for processing a test instance before it is destroyed.