Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AssertJ dependency if using Hamcrest #648

Merged
merged 2 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/main/resources/META-INF/rewrite/hamcrest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ tags:
- hamcrest
- assertj
recipeList:
# Add dependency if not already present
- org.openrewrite.java.dependencies.AddDependency:
groupId: org.assertj
artifactId: assertj-core
version: 3.x
onlyIfUsing: org.hamcrest.*
acceptTransitive: true

# First change `is(..)` to `Matchers.is(..)` for consistent matching
- org.openrewrite.java.ChangeMethodTargetToStatic:
methodPattern: org.hamcrest.core.* *(..)
Expand Down Expand Up @@ -319,10 +327,3 @@ recipeList:
notMatcher: empty
assertion: isNotEmpty

# Add dependency if not already present
- org.openrewrite.java.dependencies.AddDependency:
groupId: org.assertj
artifactId: assertj-core
version: 3.x
onlyIfUsing: org.assertj.core.api.Assertions
acceptTransitive: true
Loading
Loading