This version is still in development and is not considered stable yet.
For the latest stable version, please use JUnit 6.0.1!

Test Instance Pre-construct Callback

TestInstancePreConstructCallback defines the API for Extensions that wish to be invoked prior to test instances being constructed (by a constructor call or via TestInstanceFactory).

This extension provides a symmetric call to TestInstancePreDestroyCallback and is useful in combination with other extensions to prepare constructor parameters or keeping track of test instances and their lifecycle.

Accessing the test-scoped ExtensionContext

You may override the getTestInstantiationExtensionContextScope(…​) method to return TEST_METHOD to make test-specific data available to your extension implementation or if you want to keep state on the test method level.