5.4. Test Instance Factories
[TestInstanceFactory](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/extension/TestInstanceFactory.html)
defines the API for Extensions
that wish to create test class instances.
Common use cases include acquiring the test instance from a dependency injection framework or invoking a static factory method to create the test class instance.
If no TestInstanceFactory
is registered, the framework will invoke the sole constructor for the test class to instantiate it, potentially resolving constructor arguments via registered ParameterResolver
extensions.
Extensions that implement TestInstanceFactory
can be registered on test interfaces, top-level test classes, or @Nested
test classes.
Registering multiple extensions that implement |