Class JUnitFailToAssertJFail
- java.lang.Object
-
- org.openrewrite.Recipe
-
- org.openrewrite.java.testing.assertj.JUnitFailToAssertJFail
-
public class JUnitFailToAssertJFail extends org.openrewrite.RecipeThis is a refactoring visitor that will convert JUnit-style fail() to assertJ's fail().This visitor only supports the migration of the following JUnit 5 fail() methods:
fail() == fail("") fail(String message) == fail(String message) fail(String message, Throwable cause) == fail(String message, Throwable cause) fail(Throwable cause) == fail("", Throwable cause)Note: There is an additional method signature in JUnit that accepts a StringSupplier as an argument. Attempts to map this signature into assertJ's model obfuscates the original assertion.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJUnitFailToAssertJFail.JUnitFailToAssertJFailVisitor
-
Constructor Summary
Constructors Constructor Description JUnitFailToAssertJFail()
-
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
-
-