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