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. |
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 |
timtebeek
left a comment
There was a problem hiding this comment.
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-junitdependency when running theJUnit4to5Migrationrecipe.What's your motivation?
The dependency is not needed in the Junit 5 context (AFAIK)