Class JUnitAssertSameToAssertThat
- java.lang.Object
-
- org.openrewrite.Recipe
-
- org.openrewrite.java.testing.assertj.JUnitAssertSameToAssertThat
-
public class JUnitAssertSameToAssertThat extends org.openrewrite.RecipeThis is a refactoring visitor that will convert JUnit-style assertSame() to assertJ's assertThat().isSameAs().This visitor only supports the migration of the following JUnit 5 assertSame() methods:
assertSame(Object expected, Object actual) == assertThat(actual).isSameAs(expected) assertSame(Object expected, Object actual, String message) == assertThat(actual).as(message).isSameAs(expected) assertSame(Object expected, Object actual, Supplier
messageSupplier) == assertThat(actual).withFailMessage(messageSupplier).isSameAs(expected);
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJUnitAssertSameToAssertThat.AssertSameToAssertThatVisitor
-
Constructor Summary
Constructors Constructor Description JUnitAssertSameToAssertThat()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescription()java.lang.StringgetDisplayName()protected org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext>getVisitor()
-
-
-
Method Detail
-
getDisplayName
public java.lang.String getDisplayName()
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
public java.lang.String getDescription()
- Overrides:
getDescriptionin classorg.openrewrite.Recipe
-
getVisitor
protected org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()
- Overrides:
getVisitorin classorg.openrewrite.Recipe
-
-