Skip to content
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

Consider adding a @JunitParam or something similar which would allow Arquillian to ignore the method parameter #610

Open
jamezp opened this issue Aug 13, 2024 · 5 comments

Comments

@jamezp
Copy link
Collaborator

jamezp commented Aug 13, 2024

Issue Overview

Both Arquillian and JUnit 5 allow for parameters to be resolved for methods. In #608 we added support for this. However, there could be cases when we want have Arquillian ignore those parameters. For those cases we should we should add parameter, something like @JunitParam or @ArquillianIgnore which will allow other ParameterResolver's to resolve the method parameter.

@rhusar
Copy link
Collaborator

rhusar commented Aug 13, 2024

Theoretically, if there were to be multiple ParameterResolvers apart from new Arquillian one and the existing JUnit one, the @JunitParam wouldn't be exactly correct.
IIUC the annotation is meant to "do not use arquillian parameter resolution for this parameter", so perhaps something like @SkipArquillianParameterResolution or @SkipArquillianParameterResolver? :-)

@jamezp
Copy link
Collaborator Author

jamezp commented Aug 13, 2024

Yes, that's where I got @ArquillianIgnore from. I was trying to think of something somewhat short.

@rhusar
Copy link
Collaborator

rhusar commented Aug 14, 2024

Yes, that's where I got @ArquillianIgnore from. I was trying to think of something somewhat short.

I am afraid it cannot be short without compromising on clarity since stuff like ArquillianIgnore can easily be mistaken for being something else. Sounds to me it should be at least 3 words - @Ignore/Skip-Arquillian-Resolution/Resolver/Parameter

@hantsy
Copy link
Member

hantsy commented Sep 2, 2024

The JunitParam will be applied on the original Junit parameter injection?

How to keep the compatible with the existing testing libs that already used the JUnit param injection. If we need an explicit qulifier for our Arquillian param injection, I would like to add the annotation to the Arquillian method params. eg. @ArquillianParam, it also can be used for CDI scan to filter the method injections.

@jamezp
Copy link
Collaborator Author

jamezp commented Sep 6, 2024

@hantsy Sorry for the delayed response. This is only an issue if there is a conflict to a parameter both JUnit and Arquillian can produce. For example, if you created a JUnit ParameterResolver for URI, Arquillian might be the one injecting the URI instead of your custom ParameterResolver.

What an introduced annotation would do is act like a CDI @Vetoed annotation where Arquillian would not attempt to inject the parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants