Skip to content

Allow ArgumentsProviders to register additional extensions #3282

@fmeum

Description

@fmeum

I have a use case in which I would like to intercept only certain invocations of a @ParameterizedTest, namely those where the arguments come from a particular ArgumentsProvider. Since the information about which ArgumentsProvider provided the current set of arguments isn't available in e.g. InvocationInterceptor#interceptTestTemplateMethod, this doesn't seem to be possible today.

TestTemplateInvocationContext#getAdditionalExtensions would allow doing that, but it can't be populated from an ArgumentsProvider. I thus propose exposing this functionality via a new getAdditionalExtensions() method on ArgumentsProvider.

Deliverables

  • Add a new default method List<Extension> getAdditionalExtensions() to ArgumentsProvider. In ParameterizedTestExtension, forward the additional extensions to the ParameterizedTestInvocationContext.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions