Investigate parameter targeting of CartesianProductTest arguments source annotations
See original GitHub issueA very strong argument can be made that it’s much more convenient to define a CartesianProductTest like the following:
@CartesianProductTest
void test(
@CartesianValueSource(strings = { "A", "B", "C" }) String str,
@CartesianEnumSource(ChronoUnit.class) ChronoUnit unit
) {
// some passing test code here
}
Investigate if this is possible - it is likely it is not possible, because of how the annotations invoke their corresponding ArgumentsProvider
implementations, but it might work.
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Non-adjacent repeatable annotations do not work ... - GitHub
While working on #414, I realized there is a nasty issue when repeatable annotations have other annotations (repeatable or not) in between.
Read more >Cartesian Product of Parameters - JUnit Pioneer
You can annotate the test parameters directly with @CartesianTest.Values , @CartesianTest.Enum , or range source annotations (see Defining arguments on ...
Read more >CartesianProductTest (junit-pioneer 1.4.1 API) - javadoc.io
This annotation is somewhat similar to @ParameterizedTest , as in it also takes arguments and can run the same test multiple times.
Read more >JUnit 5 - Parameterized Tests - nipafx.dev
This means, by annotating a parameter with either @ConvertWith or your custom annotation, JUnit Jupiter passes whatever argument a source ...
Read more >Guide to JUnit 5 Parameterized Tests - Baeldung
This source takes one array entry each time, splits it by comma and passes each array to the annotated test method as separate...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The main reason I opened this issue is because this is a frequently asked question. I would like to have a discussion/discovery about this, so I can link to it as an explanation, i.e.: “This is not possible, we investigated this in #415” or “While this is possible, the team came to a decision to not support it - see discussion on #415” or we might just decide to support it but discourage users from using it, etc.
ETA: “frequently” as in 2 people have asked this so far.
I like the Long and the Nested names, cause they are clearly associated with the CartesainProduct-Extection From those two the Long are somehow clumsy, so I would like to go with the Nested