From 9c4d117a794be696a003f3cc8225cc8b5b26385b Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Mon, 5 Feb 2024 09:02:30 +0000 Subject: [PATCH] refactor: Remove `public` visibility of JUnit 5 tests Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.testing.cleanup.TestsShouldNotBePublic?organizationId=T3BlblJld3JpdGU%3D Co-authored-by: Moderne --- .../java/org/openrewrite/analysis/InvocationMatcherTest.java | 2 +- .../openrewrite/analysis/dataflow/ExternalFlowModelsTest.java | 2 +- .../analysis/dataflow/ExternalModelMethodMatcherTest.java | 2 +- .../openrewrite/analysis/dataflow/ExternalSinkModelsTest.java | 2 +- .../org/openrewrite/analysis/search/UsesAllInvocationsTest.java | 2 +- .../org/openrewrite/analysis/trait/variable/ParameterTest.java | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/openrewrite/analysis/InvocationMatcherTest.java b/src/test/java/org/openrewrite/analysis/InvocationMatcherTest.java index ef60c9ecc..9557c5d48 100644 --- a/src/test/java/org/openrewrite/analysis/InvocationMatcherTest.java +++ b/src/test/java/org/openrewrite/analysis/InvocationMatcherTest.java @@ -27,7 +27,7 @@ import static org.openrewrite.java.Assertions.java; -public class InvocationMatcherTest implements RewriteTest { +class InvocationMatcherTest implements RewriteTest { static JavaIsoVisitor matcherVisitor(Predicate match) { return new JavaIsoVisitor<>() { diff --git a/src/test/java/org/openrewrite/analysis/dataflow/ExternalFlowModelsTest.java b/src/test/java/org/openrewrite/analysis/dataflow/ExternalFlowModelsTest.java index 779696412..c4c2f60e1 100644 --- a/src/test/java/org/openrewrite/analysis/dataflow/ExternalFlowModelsTest.java +++ b/src/test/java/org/openrewrite/analysis/dataflow/ExternalFlowModelsTest.java @@ -23,7 +23,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class ExternalFlowModelsTest { +class ExternalFlowModelsTest { @Test void listFlowModelsOptimized() { final var externalFlowModels = ExternalFlowModels.instance(); diff --git a/src/test/java/org/openrewrite/analysis/dataflow/ExternalModelMethodMatcherTest.java b/src/test/java/org/openrewrite/analysis/dataflow/ExternalModelMethodMatcherTest.java index 8ed2b9aaf..9e28e9e66 100644 --- a/src/test/java/org/openrewrite/analysis/dataflow/ExternalModelMethodMatcherTest.java +++ b/src/test/java/org/openrewrite/analysis/dataflow/ExternalModelMethodMatcherTest.java @@ -30,7 +30,7 @@ import static org.openrewrite.test.RewriteTest.toRecipe; @SuppressWarnings({"ResultOfMethodCallIgnored", "UnnecessaryCallToStringValueOf", "StringOperationCanBeSimplified"}) -public class ExternalModelMethodMatcherTest implements RewriteTest { +class ExternalModelMethodMatcherTest implements RewriteTest { static Supplier> fromModel( String namespace, String type, diff --git a/src/test/java/org/openrewrite/analysis/dataflow/ExternalSinkModelsTest.java b/src/test/java/org/openrewrite/analysis/dataflow/ExternalSinkModelsTest.java index 4513170b5..aa663e09e 100644 --- a/src/test/java/org/openrewrite/analysis/dataflow/ExternalSinkModelsTest.java +++ b/src/test/java/org/openrewrite/analysis/dataflow/ExternalSinkModelsTest.java @@ -22,7 +22,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -public class ExternalSinkModelsTest { +class ExternalSinkModelsTest { @Test void listSinkModelsOptimized() { diff --git a/src/test/java/org/openrewrite/analysis/search/UsesAllInvocationsTest.java b/src/test/java/org/openrewrite/analysis/search/UsesAllInvocationsTest.java index 9aebc36fa..bc9a01320 100644 --- a/src/test/java/org/openrewrite/analysis/search/UsesAllInvocationsTest.java +++ b/src/test/java/org/openrewrite/analysis/search/UsesAllInvocationsTest.java @@ -24,7 +24,7 @@ import static org.openrewrite.java.Assertions.java; @LoathingOfOthers("This is basically a copy-paste of UsesAllMethodsTest.java in rewrite-java-test") -public class UsesAllInvocationsTest implements RewriteTest { +class UsesAllInvocationsTest implements RewriteTest { @DocumentExample @Test diff --git a/src/test/java/org/openrewrite/analysis/trait/variable/ParameterTest.java b/src/test/java/org/openrewrite/analysis/trait/variable/ParameterTest.java index bbf198931..6543b2b67 100644 --- a/src/test/java/org/openrewrite/analysis/trait/variable/ParameterTest.java +++ b/src/test/java/org/openrewrite/analysis/trait/variable/ParameterTest.java @@ -34,7 +34,7 @@ import static org.openrewrite.java.Assertions.java; import static org.openrewrite.test.RewriteTest.toRecipe; -public class ParameterTest implements RewriteTest { +class ParameterTest implements RewriteTest { static Supplier> visitVariable( BiFunction visitor