-
Notifications
You must be signed in to change notification settings - Fork 81
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
Only add hamcrest-junit
dependency when using assertThat
or assumeThat
#577
Only add hamcrest-junit
dependency when using assertThat
or assumeThat
#577
Conversation
How does this interact with this recipe a little further up/down? As we seem to add that explicitly in a JUnit 5 upgrade
rewrite-testing-frameworks/src/main/resources/META-INF/rewrite/junit5.yml Lines 166 to 172 in b7d3b84
What makes that the dependency is not or no longer needed in your case? |
Hmm, you are right. Probably some more investigation is needed as to when the dependency is needed/when it can be removed. As far as I can tell, Junit 5 also has support for Assumptions. |
src/test/java/org/openrewrite/java/testing/hamcrest/AddHamcrestJUnitDependencyTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/hamcrest/AddHamcrestJUnitDependencyTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/testing/hamcrest/AddHamcrestJUnitDependencyTest.java
Outdated
Show resolved
Hide resolved
hamcrest-junit
dependency when using assertThat
or assumeThat
This was a fun one @FieteO ; thanks for raising this for visibility. Turns out we were a little too eager adding that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up removing the declarative AddDependency
that was there before, and implementing a scanning recipe that's a little more selective. Thanks again for calling out this issue with over eager dependency addition!
Great, that there indeed was something to improve here. Thanks @timtebeek for working on this. |
What's changed?
Remove the
hamcrest-junit
dependency when running theJUnit4to5Migration
recipe.What's your motivation?
The dependency is not needed in the Junit 5 context (AFAIK)