Skip to content

Commit

Permalink
Add AssertJ dependency if using Hamcrest (#648)
Browse files Browse the repository at this point in the history
* Add AssertJ dependency if using Hamcrest

* Restore `withToolingApi()`
  • Loading branch information
timtebeek authored Dec 4, 2024
1 parent b0df4cc commit 433685e
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 183 deletions.
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

0 comments on commit 433685e

Please sign in to comment.