question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add @CartesianEnumSource

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
Michael1993commented, Dec 3, 2020

Feel free to review the PR implementing the change. All feedback is appreciated.

1reaction
scordiocommented, Jan 12, 2021

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found