Skip to content

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/main/java/org/openrewrite/java/testing/arquillian/ReplaceArquillianInSequenceAnnotation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
5151

5252
@Override
5353
public J.ClassDeclaration visitClassDeclaration(J.ClassDeclaration classDecl, ExecutionContext ctx) {
54-
doAfterVisit(new ChangeType(IN_SEQUENCE, "org.junit.jupiter.api.Order", true).getVisitor());
54+
doAfterVisit(new ChangeType(IN_SEQUENCE, "org.junit.jupiter.api.Order", true, null).getVisitor());
5555
return super.visitClassDeclaration(classDecl, ctx);
5656
}
5757

src/main/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionCon
7373
J.CompilationUnit c = super.visitCompilationUnit(cu, ctx);
7474
doAfterVisit(new TestCaseVisitor());
7575
// ChangeType for org.junit.Assert method invocations because TestCase extends org.junit.Assert
76-
doAfterVisit(new ChangeType("junit.framework.TestCase", "org.junit.Assert", true).getVisitor());
77-
doAfterVisit(new ChangeType("junit.framework.Assert", "org.junit.Assert", true).getVisitor());
76+
doAfterVisit(new ChangeType("junit.framework.TestCase", "org.junit.Assert", true, null).getVisitor());
77+
doAfterVisit(new ChangeType("junit.framework.Assert", "org.junit.Assert", true, null).getVisitor());
7878
doAfterVisit(new AssertToAssertions.AssertToAssertionsVisitor());
7979
doAfterVisit(new UseStaticImport("org.junit.jupiter.api.Assertions assert*(..)").getVisitor());
8080
doAfterVisit(new UseStaticImport("org.junit.jupiter.api.Assertions fail*(..)").getVisitor());

src/main/java/org/openrewrite/java/testing/junit5/TemporaryFolderToTempDir.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public J visitCompilationUnit(J.CompilationUnit cu, ExecutionContext ctx) {
6666
J.CompilationUnit c = (J.CompilationUnit) super.visitCompilationUnit(cu, ctx);
6767
if (c != cu) {
6868
c = (J.CompilationUnit) new ChangeType(
69-
"org.junit.rules.TemporaryFolder", "java.io.File", true).getVisitor()
69+
"org.junit.rules.TemporaryFolder", "java.io.File", true, null).getVisitor()
7070
.visit(c, ctx);
7171
maybeAddImport("java.io.File");
7272
maybeAddImport("org.junit.jupiter.api.io.TempDir");

src/main/java/org/openrewrite/java/testing/junit5/TestRuleToTestInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ public J visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx)
8080
return mi;
8181
}
8282
});
83-
doAfterVisit(new ChangeType("org.junit.rules.TestName", "java.lang.String", true).getVisitor());
84-
doAfterVisit(new ChangeType("org.junit.Before", "org.junit.jupiter.api.BeforeEach", true).getVisitor());
83+
doAfterVisit(new ChangeType("org.junit.rules.TestName", "java.lang.String", true, null).getVisitor());
84+
doAfterVisit(new ChangeType("org.junit.Before", "org.junit.jupiter.api.BeforeEach", true, null).getVisitor());
8585
return compilationUnit;
8686
}
8787

src/main/java/org/openrewrite/java/testing/junit5/UpdateBeforeAfterAnnotations.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public static class UpdateBeforeAfterAnnotationsVisitor extends JavaIsoVisitor<E
5151
@Override
5252
public J preVisit(J tree, ExecutionContext ctx) {
5353
stopAfterPreVisit();
54-
doAfterVisit(new ChangeType("org.junit.Before", "org.junit.jupiter.api.BeforeEach", true).getVisitor());
55-
doAfterVisit(new ChangeType("org.junit.After", "org.junit.jupiter.api.AfterEach", true).getVisitor());
56-
doAfterVisit(new ChangeType("org.junit.BeforeClass", "org.junit.jupiter.api.BeforeAll", true).getVisitor());
57-
doAfterVisit(new ChangeType("org.junit.AfterClass", "org.junit.jupiter.api.AfterAll", true).getVisitor());
54+
doAfterVisit(new ChangeType("org.junit.Before", "org.junit.jupiter.api.BeforeEach", true, null).getVisitor());
55+
doAfterVisit(new ChangeType("org.junit.After", "org.junit.jupiter.api.AfterEach", true, null).getVisitor());
56+
doAfterVisit(new ChangeType("org.junit.BeforeClass", "org.junit.jupiter.api.BeforeAll", true, null).getVisitor());
57+
doAfterVisit(new ChangeType("org.junit.AfterClass", "org.junit.jupiter.api.AfterAll", true, null).getVisitor());
5858
return tree;
5959
}
6060
}

src/main/java/org/openrewrite/java/testing/junit5/UpdateTestAnnotation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionCon
7171
Set<NameTree> nameTreeSet = c.findType("org.junit.Test");
7272
if (!nameTreeSet.isEmpty()) {
7373
// Update other references like `Test.class`.
74-
c = (J.CompilationUnit) new ChangeType("org.junit.Test", "org.junit.jupiter.api.Test", true)
74+
c = (J.CompilationUnit) new ChangeType("org.junit.Test", "org.junit.jupiter.api.Test", true, null)
7575
.getVisitor().visitNonNull(c, ctx);
7676
}
7777

src/main/java/org/openrewrite/java/testing/junit5/UseWiremockExtension.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
5151
public J preVisit(J tree, ExecutionContext ctx) {
5252
if (tree instanceof JavaSourceFile) {
5353
doAfterVisit(new ChangeType("com.github.tomakehurst.wiremock.junit.WireMockRule",
54-
"com.github.tomakehurst.wiremock.junit5.WireMockExtension", true).getVisitor());
54+
"com.github.tomakehurst.wiremock.junit5.WireMockExtension", true, null).getVisitor());
5555
}
5656
return tree;
5757
}
@@ -62,7 +62,7 @@ public J visitNewClass(J.NewClass newClass, ExecutionContext ctx) {
6262
J.NewClass n = (J.NewClass) super.visitNewClass(newClass, ctx);
6363
if (newWiremockRule.matches(n)) {
6464
maybeAddImport("com.github.tomakehurst.wiremock.junit5.WireMockExtension");
65-
doAfterVisit(new ChangeType("org.junit.Rule", "org.junit.jupiter.api.extension.RegisterExtension", true)
65+
doAfterVisit(new ChangeType("org.junit.Rule", "org.junit.jupiter.api.extension.RegisterExtension", true, null)
6666
.getVisitor());
6767

6868
Expression arg = n.getArguments().get(0);

0 commit comments

Comments
 (0)