Using the ParameterResolver Extension

Learn to use ParameterResolver extension.

The ParameterResolver extension allows us to resolve a constructor or method parameter of a test.

We have to create a class that extends the ParameterResolver interface. This allows us to write an extension to access the parameter resolution access point.

Use case for the ParameterResolver extension

TestInfoParameterResolver, TestReporterParameterResolver and RepetitionInfoParameterResolver are examples of the usage of the ParameterResolver interface.

Code example

The code below demonstrates how we can write our own ParameterResolver.

Get hands-on with 1200+ tech skills courses.