openrewrite / rewrite-testing-frameworks

OpenRewrite recipes that perform common Java testing migration tasks.
Apache License 2.0
68 stars 57 forks source link

HamcrestMatcherToAssertJ does not support matchers from "org.hamcrest.core.*" #519

Closed Saturas89 closed 2 weeks ago

Saturas89 commented 3 weeks ago

What version of OpenRewrite are you using?

I am using

How are you running OpenRewrite?

I am using the Maven plugin, and my project is a single module project.

<plugin>
  <groupId>org.openrewrite.maven</groupId>
  <artifactId>rewrite-maven-plugin</artifactId>
  <version>5.32.1</version>
  <configuration>
    <activeRecipes>                                                    <recipe>org.openrewrite.java.testing.hamcrest.HamcrestMatcherToAssertJ</recipe>
    </activeRecipes>
  </configuration>
</plugin>

What is the smallest, simplest way to reproduce the problem?

Using the hamcrest matchers from the core package.

import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNot.not;
import static org.hamcrest.core.IsSame.sameInstance;

What did you expect to see?

That the matchers are replaced with the assertJ assertions.

timtebeek commented 2 weeks ago

Thanks for bringing this to our attention @Saturas89 ! Should be fixed with