Description
Overview
In Mockito, we want to support injection of multiple parameters. To that end, we have to check for a multitude of acceptable annotations and then later act on that annotation. This issue appeared when working on mockito/mockito#1503 which had to add a new annotation (@Captor
) besides our @Mock
injection-capabilities.
The author of the PR wrote a CompositeParameterResolver which would support this usecase. However, it feels like this kind of solution should live in JUnit, rather than being Mockito-specific. I would suspect that other projects will run into this problem (eventually).
Therefore, I would like to request a JUnit-official implementation for the use-case of composing various resolvers into a single parameter resolver, that then can be used in the extension.
Related Issues
- Support composability for
ParameterResolver
s #1802 - Support fallback parameter resolution extension #1945
Deliverables
- A means to compose multiple parameter resolvers together, such that an extension can provide a list of resolvers and pass that automatically in
resolveParameter
.