Skip to content

Support composition of multiple parameterResolvers #1604

Closed

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

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions