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
CartesianArgumentsProvider is not intuitive to implement #520
Comments
While working on some tests for PR #519 which is linked to this issue. I came to something which confuses me. It is junit-pioneer/src/main/java/org/junitpioneer/jupiter/cartesian/CartesianTestExtension.java Lines 75 to 77 in bd6d994
That error makes it like method level argument sources are allowed. However, if we do that it is not working. That can be seen in junit-pioneer/src/main/java/org/junitpioneer/jupiter/cartesian/CartesianTestExtension.java Line 69 in bd6d994
parameterArgumentsSources are passed to the getSetsFromArgumentsSource . What is the goal here?
|
There are currently no method-level argument sources for |
Thanks for the clarification @Michael1993. My changes in PR #519 could actually help with that as well. You could pass each parameter to the method cartesian argument source. That way your custom implementation also has access to the parameter. |
Thank you for opening the requested issue. It's more clearer for me now! |
If I am a library developer that would like to implement a
CartesianArgumentsProvider
I would have to make my class be stateful and I would have to make my implementation implementArgumentsProvider
(even if I don't want to do that).The current API looks like this:
This means that if my implementation is both for
@CartesianTest
and@ParametrizedTest
then I have to have a state in it and implementAnnotationConsumer
.In addition to that there is no way for me to use a
CartesianArgumentsProvider
without creating an annotation. For example for@ParametrizedTest
I can do the following:However, I cannot do something like
Because
@ArgumentsSource
is from JUnit jupiter and its target is onlyANNOTATION_TYPE
andMETHDO
.The text was updated successfully, but these errors were encountered: