open-feature / open-feature/java-sdk-contrib

[Junit5 extension] Run test multiple times for the same flag with different values

Open
#957 12 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.