diff --git a/src/main/java/org/openrewrite/java/testing/junit5/LifecycleNonPrivate.java b/src/main/java/org/openrewrite/java/testing/junit5/LifecycleNonPrivate.java index 60f4881fb..273362d04 100644 --- a/src/main/java/org/openrewrite/java/testing/junit5/LifecycleNonPrivate.java +++ b/src/main/java/org/openrewrite/java/testing/junit5/LifecycleNonPrivate.java @@ -39,6 +39,7 @@ public class LifecycleNonPrivate extends Recipe { "org.junit.jupiter.api.AfterEach", "org.junit.jupiter.api.BeforeAll", "org.junit.jupiter.api.BeforeEach"); + @SuppressWarnings("unchecked") private static final TreeVisitor PRECONDITION = Preconditions.or(ANNOTATION_TYPES.stream().map(r -> new UsesType<>(r, false)).toArray(UsesType[]::new)); diff --git a/src/main/java/org/openrewrite/java/testing/junit5/ParameterizedRunnerToParameterized.java b/src/main/java/org/openrewrite/java/testing/junit5/ParameterizedRunnerToParameterized.java index 1a30b6cd1..fa8d51a3e 100644 --- a/src/main/java/org/openrewrite/java/testing/junit5/ParameterizedRunnerToParameterized.java +++ b/src/main/java/org/openrewrite/java/testing/junit5/ParameterizedRunnerToParameterized.java @@ -142,8 +142,10 @@ private static class ParameterizedRunnerToParameterizedTestsVisitor extends Java private final J.ClassDeclaration scope; private final String initMethodName; private final List parameterizedTestMethodParameters; + @Nullable private final List parameterizedTestAnnotationParameters; + private final String initStatementParamString; private final JavaTemplate parameterizedTestTemplate; diff --git a/src/test/java/org/openrewrite/java/testing/hamcrest/MigrateHamcrestToAssertJTest.java b/src/test/java/org/openrewrite/java/testing/hamcrest/MigrateHamcrestToAssertJTest.java index bc3c30f62..685f993df 100644 --- a/src/test/java/org/openrewrite/java/testing/hamcrest/MigrateHamcrestToAssertJTest.java +++ b/src/test/java/org/openrewrite/java/testing/hamcrest/MigrateHamcrestToAssertJTest.java @@ -522,6 +522,7 @@ void test() { } } """; + @Language("java") private static final String JAVA_AFTER = """ import org.junit.jupiter.api.Test;