- 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.
TestInstancePreConstructCallback defines the API for
Extensions that wish to be invoked prior to creation of test instances.
This extension is a symmetric counterpart to
The use cases for this extension may include preparing context-sensitive arguments
that are injected into the instance's constructor.
Extensions that implement
TestInstancePreConstructCallback must be
registered at the class level if the test class is configured with
@TestInstance(Lifecycle.PER_CLASS) semantics. If the test
class is configured with
TestInstancePreConstructCallback extensions may be registered at the
class level or at the method level. In the latter case, the extension will
only be applied to the test method for which it is registered.
Consult the documentation in
Extension for details on constructor
(TestInstanceFactoryContext factoryContext, ExtensionContext context) throws ExceptionCallback invoked prior to test instances being constructed.
factoryContext- the context for the test instance about to be instantiated; never
context- the current extension context; never