open-feature / open-feature/java-sdk-contrib
[Junit5 extension] Run test multiple times for the same flag with different values
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 49
- Forks
- 81
- Avg merge
- 20h 3m
- Merged PRs (30d)
- 6
Description
Sometimes, you want to ensure that your code behaves the same way for all code paths, even if different feature flags are involved.
Junit5 has parameterized tests to run multiple tests based on a source. This approach is not feasible for us, as it only generates an array of possible argument sets.
We need to find a way (maybe with our annotation) to create such tests. The cartesian test extension of JUnit Pioneer can be an inspiration for this https://github.com/junit-pioneer/junit-pioneer/blob/main/src/main/java/org/junitpioneer/jupiter/cartesian/CartesianTest.java
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the JUnit 5 parameterized-test documentation and the linked JUnit Pioneer CartesianTest.java for comparable extension behavior. Clarify how the existing annotation and feature-flag values should be represented, then define tests showing that one flag can run with multiple values and that all intended paths execute.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100