File tree Expand file tree Collapse file tree 2 files changed +42
-1
lines changed
main/resources/META-INF/rewrite
test/java/org/openrewrite/java/testing/hamcrest Expand file tree Collapse file tree 2 files changed +42
-1
lines changed Original file line number Diff line number Diff line change 4141recipeList :
4242 # First change `is(..)` to `Matchers.is(..)` for consistent matching
4343 - org.openrewrite.java.ChangeMethodTargetToStatic :
44- methodPattern : org.hamcrest.core.Is is (..)
44+ methodPattern : org.hamcrest.core.* * (..)
4545 fullyQualifiedTargetTypeName : org.hamcrest.Matchers
4646
4747 # Then remove wrapping `is(Matcher)` calls such that further recipes will match
Original file line number Diff line number Diff line change @@ -719,4 +719,45 @@ void ba() {
719719 )
720720 );
721721 }
722+
723+ @ Test
724+ @ Issue ("https://github.com/openrewrite/rewrite-testing-frameworks/issues/519" )
725+ void isEqualMatcherFromCore () {
726+ rewriteRun (
727+ //language=java
728+ java (
729+ """
730+ import static org.hamcrest.MatcherAssert.assertThat;
731+ import static org.hamcrest.core.IsEqual.equalTo;
732+ import static org.hamcrest.core.IsNot.not;
733+ import static org.hamcrest.core.IsSame.sameInstance;
734+
735+ import org.junit.jupiter.api.Test;
736+
737+ class DebugTest {
738+ @Test
739+ void ba() {
740+ assertThat(System.out, equalTo(System.out));
741+ assertThat(System.out, not(System.out));
742+ assertThat(System.out, sameInstance(System.out));
743+ }
744+ }
745+ """ ,
746+ """
747+ import static org.assertj.core.api.Assertions.assertThat;
748+
749+ import org.junit.jupiter.api.Test;
750+
751+ class DebugTest {
752+ @Test
753+ void ba() {
754+ assertThat(System.out).isEqualTo(System.out);
755+ assertThat(System.out).isNotEqualTo(System.out);
756+ assertThat(System.out).isSameAs(System.out);
757+ }
758+ }
759+ """
760+ )
761+ );
762+ }
722763}
You can’t perform that action at this time.
0 commit comments