Skip to content

Contribute AddMockitoJavaAgentToMavenSurefirePlugin Recipe#1128

Merged
timtebeek merged 15 commits into
openrewrite:mainfrom
ryan-hudson:rewrite-migrate-java/mockito-dynamic-agent-recipe
Jun 10, 2026
Merged

Contribute AddMockitoJavaAgentToMavenSurefirePlugin Recipe#1128
timtebeek merged 15 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
Contributor
  • 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 11 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.

@timtebeek timtebeek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the contribution here @ryan-hudson ! I've applied some polish to make it smaller and adhere to a few conventions we use.

@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Jun 10, 2026
@timtebeek timtebeek merged commit 5526dd1 into openrewrite:main Jun 10, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants