Skip to content

Commit 766f6be

Browse files
1 parent e85e34d commit 766f6be

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public J.CompilationUnit visitCompilationUnit(J.CompilationUnit cu, ExecutionCon
8383

8484
@SuppressWarnings("ConstantConditions")
8585
@Override
86-
public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
86+
public J.@Nullable MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
8787
J.MethodInvocation mi = super.visitMethodInvocation(method, ctx);
8888
if ((mi.getSelect() != null && TypeUtils.isOfClassType(mi.getSelect().getType(), "junit.framework.TestCase")) ||
8989
(mi.getMethodType() != null && TypeUtils.isOfClassType(mi.getMethodType().getDeclaringType(), "junit.framework.TestCase"))) {
@@ -136,7 +136,7 @@ public J.MethodDeclaration visitMethodDeclaration(J.MethodDeclaration method, Ex
136136
}
137137

138138
@Override
139-
public J.MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
139+
public J.@Nullable MethodInvocation visitMethodInvocation(J.MethodInvocation method, ExecutionContext ctx) {
140140
// If the class no longer extends TestCase there should no longer be calls to TestCase.super()
141141
// Plenty of edge cases around classes which extend classes which extend TestCase this doesn't account for
142142
if (TEST_CASE_SUPER_MATCHER.matches(method)) {

src/test/java/org/openrewrite/java/testing/junit5/MigrateJUnitTestCaseTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public void tearDown() {
339339
}
340340

341341
@Test
342-
void testCaseWithConstructorCallingSuperTestName() {
342+
void caseWithConstructorCallingSuperTestName() {
343343
//language=java
344344
rewriteRun(
345345
java(

src/test/java/org/openrewrite/java/testing/junit5/UseXMLUnitLegacyTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,3 @@ void shouldMigrateMavenDependency() {
5757
);
5858
}
5959
}
60-

0 commit comments

Comments
 (0)