Skip to content

Contribute AddMockitoJavaAgentToMavenSurefirePlugin Recipe#1128

Open
ryan-hudson wants to merge 8 commits into
openrewrite:mainfrom
ryan-hudson:rewrite-migrate-java/mockito-dynamic-agent-recipe
Open

Contribute AddMockitoJavaAgentToMavenSurefirePlugin Recipe#1128
ryan-hudson wants to merge 8 commits into
openrewrite:mainfrom
ryan-hudson:rewrite-migrate-java/mockito-dynamic-agent-recipe

Conversation

@ryan-hudson

@ryan-hudson ryan-hudson commented Jun 8, 2026

Copy link
Copy Markdown
  • This recipe replaces the existing AddSurefireFailsafeArgLineForMockito recipe called as part of the Java 25 upgrade stack with a new recipe that adds the preferred argLine syntax specified by Mockito. See issue Revising AddSurefireFailsafeArgLineForMockito #1107 for more details.

Hudson, Ryan added 2 commits June 8, 2026 13:54
…er recipe alignment to Mockito recommendations.
…er recipe alignment to Mockito recommendations.
@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Jun 8, 2026
@timtebeek timtebeek self-requested a review June 9, 2026 11:17
@timtebeek

Copy link
Copy Markdown
Member

@copilot resolve the merge conflicts in this pull request

timtebeek added 4 commits June 9, 2026 19:12
…mockito-dynamic-agent-recipe

# Conflicts:
#	src/main/resources/META-INF/rewrite/recipes.csv
…ore per-tag work

Move getArgLineJavaAgentArgument() and buildConfigurationTag() inside the
matched surefire branches in visitTag so they no longer run for every tag in
the pom, and replace the throwaway new ArrayList<>() default with emptyList().
Replace the /project/build/plugins XPath matchers in visitTag with the
framework MavenVisitor.isPluginTag(groupId, artifactId), which matches any
plugin under a plugins element (//plugins/plugin) and therefore also covers
surefire declarations in build/pluginManagement/plugins. Handle the argLine
configuration entirely at the plugin-tag level. Add a test augmenting a
surefire plugin declared in pluginManagement.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants