File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
java/org/openrewrite/java/testing/junit5
resources/META-INF/rewrite Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1818import org .openrewrite .java .AddImport ;
1919import org .openrewrite .java .AutoFormat ;
2020import org .openrewrite .java .ChangeType ;
21+ import org .openrewrite .java .JavaIsoRefactorVisitor ;
2122import org .openrewrite .java .JavaRefactorVisitor ;
2223import org .openrewrite .java .tree .*;
2324
3132import static org .openrewrite .Formatting .format ;
3233import static org .openrewrite .Tree .randomId ;
3334
34- public class ChangeTestAnnotation extends JavaRefactorVisitor {
35+ public class ChangeTestAnnotation extends JavaIsoRefactorVisitor {
3536 public ChangeTestAnnotation () {
3637 setCursoringOn ();
3738 }
3839
3940 @ Override
40- public J visitCompilationUnit (J .CompilationUnit cu ) {
41+ public J . CompilationUnit visitCompilationUnit (J .CompilationUnit cu ) {
4142 ChangeType changeType = new ChangeType ();
4243 changeType .setType ("org.junit.Test" );
4344 changeType .setTargetType ("org.junit.jupiter.api.Test" );
@@ -47,8 +48,8 @@ public J visitCompilationUnit(J.CompilationUnit cu) {
4748 }
4849
4950 @ Override
50- public J visitMethod (J .MethodDecl method ) {
51- J .MethodDecl m = refactor ( method , super :: visitMethod );
51+ public J . MethodDecl visitMethod (J .MethodDecl method ) {
52+ J .MethodDecl m = super . visitMethod ( method );
5253
5354 boolean changed = false ;
5455 List <J .Annotation > annotations = new ArrayList <>(m .getAnnotations ());
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ visitors:
3232 - org.openrewrite.java.ChangeType :
3333 type : org.junit.Ignore
3434 targetType : org.junit.jupiter.api.Disabled
35+ - org.openrewrite.java.ChangeType :
36+ type : org.junit.Assume
37+ targetType : org.junit.jupiter.api.Assumptions
3538---
3639type : specs.openrewrite.org/v1beta/recipe
3740name : org.openrewrite.java.testing.junit5.migration
You can’t perform that action at this time.
0 commit comments