diff --git a/src/main/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCase.java b/src/main/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCase.java index 4e3e9a407..1881442e7 100644 --- a/src/main/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCase.java +++ b/src/main/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCase.java @@ -83,7 +83,7 @@ public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionCon @SuppressWarnings("ConstantConditions") @Override - public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + public J.@Nullable MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { J.MethodInvocation mi = super.visitMethodInvocation(method, ctx); if ((mi.getSelect() != null && TypeUtils.isOfClassType(mi.getSelect().getType(), "junit.framework.TestCase")) || (mi.getMethodType() != null && TypeUtils.isOfClassType(mi.getMethodType().getDeclaringType(), "junit.framework.TestCase"))) { @@ -136,7 +136,7 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, Ex } @Override - public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { + public J.@Nullable MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) { // If the class no longer extends TestCase there should no longer be calls to TestCase.super() // Plenty of edge cases around classes which extend classes which extend TestCase this doesn't account for if (TEST_CASE_SUPER_MATCHER.matches(method)) { diff --git a/src/test/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCaseTest.java b/src/test/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCaseTest.java index 48a5c1243..97ae2eed9 100644 --- a/src/test/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCaseTest.java +++ b/src/test/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCaseTest.java @@ -339,7 +339,7 @@ public void tearDown() { } @Test - void testCaseWithConstructorCallingSuperTestName() { + void caseWithConstructorCallingSuperTestName() { //language=java rewriteRun( java( diff --git a/src/test/java/org/openrewrite/java/testing/junit5/UseXMLUnitLegacyTest.java b/src/test/java/org/openrewrite/java/testing/junit5/UseXMLUnitLegacyTest.java index e7e2530eb..21a7e9688 100644 --- a/src/test/java/org/openrewrite/java/testing/junit5/UseXMLUnitLegacyTest.java +++ b/src/test/java/org/openrewrite/java/testing/junit5/UseXMLUnitLegacyTest.java @@ -57,4 +57,3 @@ void shouldMigrateMavenDependency() { ); } } -