Skip to content

docs: document JUnit 5 parameterized test configuration for Gradle#63

Open
jimisola wants to merge 1 commit into
mainfrom
docs/junit5-parameterized-tests
Open

docs: document JUnit 5 parameterized test configuration for Gradle#63
jimisola wants to merge 1 commit into
mainfrom
docs/junit5-parameterized-tests

Conversation

@jimisola

@jimisola jimisola commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Documents the Gradle systemProperty configuration that enables reqstool to track JUnit 5 parameterized test results per method
  • Added to both README.md and docs/modules/ROOT/pages/configuration.adoc
  • Covers Groovy and Kotlin DSL, all test task types (unit/integration/e2e), and the explicit-name= limitation

Background

Gradle's JUnit XML reporter writes display-name-only test case names (e.g. [1] ACTIVE) that omit the method name. Reqstool uses the method name to link test results to @SVCs-annotated methods — without it, parameterized test results are skipped with a warning. Adding systemProperty 'junit.jupiter.params.displayname.default', '{displayName}[{index}]' to all Test tasks fixes this by producing names like checkStatus(StatusType)[1].

Maven Surefire is unaffected — it always embeds the method name.

Related

Test plan

  • Add tasks.withType(Test).configureEach { systemProperty 'junit.jupiter.params.displayname.default', '{displayName}[{index}]' } to a Gradle project with @ParameterizedTest methods annotated with @SVCs
  • Run gradle build
  • Check build/test-results/**/*.xml — parameterized test case names should start with the method name (e.g. checkStatus(StatusType)[1])
  • Run reqstool status — parameterized test methods should now show as PASSED/FAILED rather than missing

Gradle's JUnit XML reporter writes display-name-only test case names
([N] args) that omit the method name, preventing reqstool from linking
parameterized test results to @SVCs-annotated methods.

Document the one-line fix (systemProperty on tasks.withType(Test)) and
note the limitation for explicit name="{index}..." annotations.

Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant