Add @CartesianEnumSource
See original GitHub issueI am currently looking for a way to provide Enum values as input of a cartesian product test.
I understand it can be achieved with a static factory method, but having something like a @CartesianEnumSource
which mimics the JUnit @EnumSource
including names
and mode
parameters would be really nice.
If this sounds reasonable, I am happy to give it a shot (probably taking inspiration from #321).
Bonus topic: it would be also nice to have a @CartesianArgumentSource
which would allow plugging in a custom ArgumentProvider
implementation. Maybe this deserves a separate issue, but I’m not sure yet about its feasibility.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Cartesian Product of Parameters - JUnit Pioneer
Enum is an annotation that might look familiar - it mimics JUnit's @EnumSource , except @CartesianTest.Enum must be put on the parameter. It...
Read more >@CartesianProductTest extension · Issue #68 · junit-pioneer ...
Ideally the @CartesianProductTest would be able to reuse any existing argument source, including the @RangeSource described in #123. For example ...
Read more >Feed multiple parameters in JUnit 5 test method - Stack Overflow
So basically I'd like to provide a cartesian product of multiple arguments to my tests. Is that possible with the out-of-the-box argument ...
Read more >[Solved]-Is there a way I could use @MethodSource and ...
Coding example for the question Is there a way I could use @MethodSource and @EnumSource in the same @ParameterizedTest-kotlin.
Read more >Cleaner parameterized tests with JUnit 5 - Codeleak.pl
To get started with parameterized tests in Junit 5 you need to add a ... @EnumSource provides a convenient way to use Enum...
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
Feel free to review the PR implementing the change. All feedback is appreciated.
@Michael1993 now that #362 is merged, I would be happy to put something together to support
@CartesianEnumSource
, just let me know if I can go ahead with it.