Class UpdateBeforeAfterAnnotations
- java.lang.Object
-
- org.openrewrite.AbstractSourceVisitor<T>
-
- org.openrewrite.AbstractRefactorVisitor<org.openrewrite.java.tree.J>
-
- org.openrewrite.java.JavaRefactorVisitor
-
- org.openrewrite.java.JavaIsoRefactorVisitor
-
- org.openrewrite.java.testing.junit5.UpdateBeforeAfterAnnotations
-
- All Implemented Interfaces:
org.openrewrite.java.JavaSourceVisitor<org.openrewrite.java.tree.J>,org.openrewrite.RefactorVisitor<org.openrewrite.java.tree.J>,org.openrewrite.SourceVisitor<org.openrewrite.java.tree.J>
public class UpdateBeforeAfterAnnotations extends org.openrewrite.java.JavaIsoRefactorVisitorThis refactor visitor will replace JUnit 4's "Before", "BeforeClass", "After", and "AfterClass" annotations with their JUnit 5 equivalents. Additionally, this visitor will reduce the visibility of methods marked with those annotations to "package" to comply with JUnit 5 best practices.org.junit.Before --> org.junit.jupiter.api.BeforeEach org.junit.After --> org.junit.jupiter.api.AfterEach org.junit.BeforeClass --> org.junit.jupiter.api.BeforeAll org.junit.AfterClass --> org.junit.jupiter.api.AfterAll
-
-
Constructor Summary
Constructors Constructor Description UpdateBeforeAfterAnnotations()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openrewrite.java.tree.J.CompilationUnitvisitCompilationUnit(org.openrewrite.java.tree.J.CompilationUnit cu)org.openrewrite.java.tree.J.MethodDeclvisitMethod(org.openrewrite.java.tree.J.MethodDecl method)-
Methods inherited from class org.openrewrite.java.JavaIsoRefactorVisitor
visitAnnotatedType, visitAnnotation, visitArrayAccess, visitArrayType, visitAssert, visitAssign, visitAssignOp, visitBinary, visitBlock, visitBreak, visitCase, visitCatch, visitClassDecl, visitContinue, visitDoWhileLoop, visitElse, visitEmpty, visitEnumValue, visitEnumValueSet, visitFieldAccess, visitFinally, visitForEachLoop, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitLabel, visitLambda, visitLiteral, visitMemberReference, visitMethodInvocation, visitMultiCatch, visitMultiVariable, visitNewArray, visitNewClass, visitPackage, visitParameterizedType, visitParentheses, visitPrimitive, visitReturn, visitStatement, visitSwitch, visitSynchronized, visitTernary, visitThrow, visitTry, visitTypeCast, visitTypeName, visitTypeParameter, visitTypeParameters, visitUnary, visitUnparsedSource, visitVariable, visitWhileLoop, visitWildcard
-
Methods inherited from class org.openrewrite.java.JavaRefactorVisitor
addImport, addImport, maybeAddImport, maybeAddImport, maybeAddImport, maybeRemoveImport, maybeRemoveImport, maybeUnwrapParentheses
-
Methods inherited from class org.openrewrite.AbstractRefactorVisitor
andThen, andThen, next, refactor, refactor, refactor
-
Methods inherited from class org.openrewrite.AbstractSourceVisitor
getCursor, setCursoringOn, visit, visitAfter, visitAfter
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrewrite.java.JavaSourceVisitor
enclosingBlock, enclosingClass, enclosingCompilationUnit, enclosingMethod, isInSameNameScope, isInSameNameScope, visitExpression
-
-
-
-
Method Detail
-
visitCompilationUnit
public org.openrewrite.java.tree.J.CompilationUnit visitCompilationUnit(org.openrewrite.java.tree.J.CompilationUnit cu)
- Specified by:
visitCompilationUnitin interfaceorg.openrewrite.java.JavaSourceVisitor<org.openrewrite.java.tree.J>- Overrides:
visitCompilationUnitin classorg.openrewrite.java.JavaIsoRefactorVisitor
-
visitMethod
public org.openrewrite.java.tree.J.MethodDecl visitMethod(org.openrewrite.java.tree.J.MethodDecl method)
- Specified by:
visitMethodin interfaceorg.openrewrite.java.JavaSourceVisitor<org.openrewrite.java.tree.J>- Overrides:
visitMethodin classorg.openrewrite.java.JavaIsoRefactorVisitor
-
-