-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow ArgumentsProvider
s to register additional extensions
#3282
Comments
@fmeum I did a quick spike of making the |
@marcphilipp That's a neat solution for my use case with little new API surface. I like it, thanks for the quick response! |
I noticed one limitation that makes this solution slightly less useful than I first thought: A single annotation cannot be meta-annotated with multiple As a result, we can't just have our custom Edit: I confirmed that this can be worked around by making the second |
@marcphilipp Since I don't know the usual processes for contributions yet: Would it help if I turned your spike into a PR with tests and docs or is this something you would like to do yourself? |
@fmeum Thanks for asking! I'd like to discuss this with the team first to avoid making you go through that unnecessarily. |
Team decision: Wait for additional interest from the community since we don't perceive this as a common use case. |
For what it's worth, I would also find this to be a useful addition and have been wanting to do something similar to what fmeum is suggesting. |
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 particularArgumentsProvider
. Since the information about whichArgumentsProvider
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 anArgumentsProvider
. I thus propose exposing this functionality via a newgetAdditionalExtensions()
method onArgumentsProvider
.Deliverables
List<Extension> getAdditionalExtensions()
toArgumentsProvider
. InParameterizedTestExtension
, forward the additional extensions to theParameterizedTestInvocationContext
.The text was updated successfully, but these errors were encountered: