5.7. Parameter Resolution
[ParameterResolver](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/extension/ParameterResolver.html)
defines the Extension
API for dynamically resolving parameters at runtime.
If a test class constructor, test method, or lifecycle method (see Test Classes and Methods) declares a parameter, the parameter must be resolved at runtime by a ParameterResolver
. A ParameterResolver
can either be built-in (see [TestInfoParameterResolver](https://github.com/junit-team/junit5/tree/r5.7.0/junit-jupiter-engine/src/main/java/org/junit/jupiter/engine/extension/TestInfoParameterResolver.java)
) or registered by the user. Generally speaking, parameters may be resolved by name, type, annotation, or any combination thereof.
If you wish to implement a custom [ParameterResolver](https://junit.org/junit5/docs/current/api/org.junit.jupiter.api/org/junit/jupiter/api/extension/ParameterResolver.html)
that resolves parameters based solely on the type of the parameter, you may find it convenient to extend the [TypeBasedParameterResolver](https://github.com/junit-team/junit5/tree/r5.7.0/junit-jupiter-api/src/main/java/org/junit/jupiter/api/extension/support/TypeBasedParameterResolver.java)
which serves as a generic adapter for such use cases.
For concrete examples, consult the source code for [CustomTypeParameterResolver](https://github.com/junit-team/junit5/tree/r5.7.0/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomTypeParameterResolver.java)
, [CustomAnnotationParameterResolver](https://github.com/junit-team/junit5/tree/r5.7.0/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/CustomAnnotationParameterResolver.java)
, and [MapOfListsTypeBasedParameterResolver](https://github.com/junit-team/junit5/tree/r5.7.0/junit-jupiter-engine/src/test/java/org/junit/jupiter/engine/execution/injection/sample/MapOfListsTypeBasedParameterResolver.java)
.
Due to a bug in the byte code generated by The
|