Respect composed JUnit test templates - #1093
Open
martinfrancois wants to merge 1 commit into
Open
Conversation
4 tasks
martinfrancois
force-pushed
the
agent/repro-add-parameterized-meta-test-template
branch
2 times, most recently
from
August 16, 2026 02:53
39e1fee to
b677586
Compare
martinfrancois
force-pushed
the
agent/repro-add-parameterized-meta-test-template
branch
from
August 16, 2026 12:23
b677586 to
763f40e
Compare
martinfrancois
marked this pull request as ready for review
August 17, 2026 08:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Suggested review order: 15 of 52 (Score: 7)
Review first: openrewrite/rewrite-static-analysis#978
What's changed?
Leaves a method unchanged when an existing annotation is directly or transitively meta-annotated with JUnit's
@TestTemplate. Methods without an existing test-template annotation still receive@ParameterizedTestwhen they use a supported parameter source.What's your motivation?
Recipe:
org.openrewrite.java.testing.junit5.AddParameterizedTestAnnotation.I found this by running
org.openrewrite.java.testing.junit5.AddParameterizedTestAnnotationfromorg.openrewrite.recipe:rewrite-testing-frameworks:3.42.0onRepositorySourceResolverFuzzTest.javain Symphony-Trello ata8013f27. I reproduced the same result with the latest released recipe artifact,org.openrewrite.recipe:rewrite-testing-frameworks:3.44.0. The selected target tests still pass, but the recipe adds a redundant JUnit test-template annotation beside Jazzer's existing@FuzzTest.Before
Actual after the recipe
Expected after the recipe
(unchanged)@FuzzTestalready participates in JUnit through@TestTemplate. Adding another test-template annotation does not improve the method and gives two extensions ownership of the same test declaration.Confirmed real-world execution
RepositorySourceResolverFuzzTest.javaata8013f27.martinfrancois/symphony-trello@a8013f27.Anything in particular you'd like reviewers to focus on?
Please review the use of
AnnotationMatchermeta-annotation traversal for Jazzer and repository-defined composed annotations.Have you considered any alternatives or workarounds?
Special-casing Jazzer would miss other composed JUnit test templates. Replacing
@FuzzTestwould disable the fuzzing engine, so recognizing the JUnit composition contract is the narrow behavior-preserving rule.Any additional context
Pre-existing tests changed: None.
martinfrancois/symphony-trello@a8013f27org.openrewrite.recipe:rewrite-testing-frameworks:3.42.0org.openrewrite.recipe:rewrite-testing-frameworks:3.44.0src/test/java/ch/fmartin/symphony/trello/tracker/TrelloCardReferenceParserFuzzTest.javaAddParameterizedTestAnnotationTestThis change was prepared with AI assistance. I reviewed the target execution evidence, implementation, tests, and contribution text.
Checklist
./gradlew buildlocally, and committed any resulting changes torecipes.csv