From 1b5ceb41eb972d9130b617fbe548b5d7f33ea63a Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sun, 2 Nov 2025 22:45:26 +0000 Subject: [PATCH] JUnit Jupiter best practices Use this link to re-run the recipe: https://app.moderne.io/recipes/org.openrewrite.java.testing.junit.JupiterBestPractices?organizationId=NzQ1YmJlODUtZjNkMy00OTNkLThhNDAtZWJmZDg4N2U1ZjU1 Co-authored-by: Moderne --- .../interactivity/DefaultPrompterComponentTest.java | 2 +- .../components/interactivity/DefaultPrompterTest.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plexus-interactivity-api/src/test/java/org/codehaus/plexus/components/interactivity/DefaultPrompterComponentTest.java b/plexus-interactivity-api/src/test/java/org/codehaus/plexus/components/interactivity/DefaultPrompterComponentTest.java index 46dbe88..5bf4a0f 100644 --- a/plexus-interactivity-api/src/test/java/org/codehaus/plexus/components/interactivity/DefaultPrompterComponentTest.java +++ b/plexus-interactivity-api/src/test/java/org/codehaus/plexus/components/interactivity/DefaultPrompterComponentTest.java @@ -31,7 +31,7 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; -public class DefaultPrompterComponentTest extends InjectedTest { +class DefaultPrompterComponentTest extends InjectedTest { @Inject private Prompter prompter; diff --git a/plexus-interactivity-api/src/test/java/org/codehaus/plexus/components/interactivity/DefaultPrompterTest.java b/plexus-interactivity-api/src/test/java/org/codehaus/plexus/components/interactivity/DefaultPrompterTest.java index e261cd3..eff571e 100644 --- a/plexus-interactivity-api/src/test/java/org/codehaus/plexus/components/interactivity/DefaultPrompterTest.java +++ b/plexus-interactivity-api/src/test/java/org/codehaus/plexus/components/interactivity/DefaultPrompterTest.java @@ -32,9 +32,9 @@ import static java.util.Objects.requireNonNull; import static org.junit.jupiter.api.Assertions.assertEquals; -public class DefaultPrompterTest { +class DefaultPrompterTest { @Test - void promptSimple() throws PrompterException { + void promptSimple() throws Exception { final InMemoryOutput out = new InMemoryOutput(); final Prompter prompter = new DefaultPrompter(out, new InMemoryInput("ok")); prompter.prompt("test"); @@ -42,7 +42,7 @@ void promptSimple() throws PrompterException { } @Test - void promptOption() throws PrompterException { + void promptOption() throws Exception { final InMemoryOutput out = new InMemoryOutput(); final Prompter prompter = new DefaultPrompter(out, new InMemoryInput("ok")); prompter.prompt("test", "value"); @@ -50,7 +50,7 @@ void promptOption() throws PrompterException { } @Test - void promptOptions() throws PrompterException { + void promptOptions() throws Exception { final InMemoryOutput out = new InMemoryOutput(); final Prompter prompter = new DefaultPrompter(out, new InMemoryInput("yes")); prompter.prompt("test", asList("yes", "no"), "value");