diff --git a/src/main/java/org/openrewrite/java/testing/junit5/AddJupiterDependencies.java b/src/main/java/org/openrewrite/java/testing/junit5/AddJupiterDependencies.java index fca16f56c..928a7646f 100644 --- a/src/main/java/org/openrewrite/java/testing/junit5/AddJupiterDependencies.java +++ b/src/main/java/org/openrewrite/java/testing/junit5/AddJupiterDependencies.java @@ -116,12 +116,12 @@ public G.CompilationUnit visitCompilationUnit(G.CompilationUnit t, ExecutionCont private static class AddJupiterMaven extends MavenIsoVisitor { AddDependency.Accumulator acc; @Override - public Xml.Document visitDocument(Xml.Document document, ExecutionContext executionContext) { + public Xml.Document visitDocument(Xml.Document document, ExecutionContext ctx) { Xml.Document d = document; List jupiterApi = getResolutionResult().findDependencies("org.junit.jupiter", "junit-jupiter-api", Scope.Test); if(jupiterApi.isEmpty()) { d = (Xml.Document) addJupiterDependency().getVisitor(acc) - .visitNonNull(d, executionContext); + .visitNonNull(d, ctx); } return d; } diff --git a/src/test/java/org/openrewrite/java/testing/junit5/JUnit5MigrationTest.java b/src/test/java/org/openrewrite/java/testing/junit5/JUnit5MigrationTest.java index 3eea76023..022b61840 100644 --- a/src/test/java/org/openrewrite/java/testing/junit5/JUnit5MigrationTest.java +++ b/src/test/java/org/openrewrite/java/testing/junit5/JUnit5MigrationTest.java @@ -340,7 +340,8 @@ void noJunitDependencyIfApiAlreadyPresent() { rewriteRun( spec -> spec.beforeRecipe(withToolingApi()), //language=groovy - buildGradle(""" + buildGradle( + """ plugins { id 'java-library' } @@ -355,7 +356,8 @@ void noJunitDependencyIfApiAlreadyPresent() { } """), //language=xml - pomXml(""" + pomXml( + """ 4.0.0 dev.ted