Class JUnitAssertNullToAssertThat
- java.lang.Object
-
- org.openrewrite.Recipe
-
- org.openrewrite.java.testing.assertj.JUnitAssertNullToAssertThat
-
public class JUnitAssertNullToAssertThat extends org.openrewrite.RecipeThis is a refactoring visitor that will convert JUnit-style assertNull() to assertJ's assertThat().isNull().This visitor only supports the migration of the following JUnit 5 assertNull() methods:
assertNull(Object actual) == assertThat(condition).isNull() assertNull(Object actual, String message) == assertThat(condition).as(message).isNull(); assertNull(Object actual, Supplier
messageSupplier) == assertThat(condition).withFailMessage(messageSupplier).isNull();
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJUnitAssertNullToAssertThat.AssertNullToAssertThatVisitor
-
Constructor Summary
Constructors Constructor Description JUnitAssertNullToAssertThat()
-
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
-
-