Remove JUnit 4 @RunWith annotations that do not require an @ExtendsWith replacement
Recipe ID
org.openrewrite.java.testing.junit5.RemoveObsoleteRunnersArtifact
org.openrewrite.recipe:rewrite-testing-frameworksSome JUnit 4 @RunWith annotations do not require replacement with an equivalent JUnit Jupiter @ExtendsWith annotation. This can be used to remove those runners that either do not have a JUnit Jupiter equivalent or do not require a replacement as part of JUnit 4 to 5 migration.
Usage
You’ll need the Moderne CLI configured before running the command below.
mod run . --recipe org.openrewrite.java.testing.junit5.RemoveObsoleteRunners --recipe-option "obsoleteRunners=org.junit.runners.JUnit4"If the recipe isn’t available locally, install it with:
mod config recipes jar install org.openrewrite.recipe:rewrite-testing-frameworks:3.43.0Options
| Name | Type | Description |
|---|---|---|
obsoleteRunnersrequired | List | The fully qualified class names of the JUnit 4 runners to be removed. e.g. org.junit.runners.JUnit4 |
Data tables
Structured output this recipe can produce.
- Source files that had resultsSource files that were modified by the recipe run.
org.openrewrite.table.SourcesFileResults - Source files that had search resultsSearch results that were found during the recipe run.
org.openrewrite.table.SearchResults - Source files that errored on a recipeThe details of all errors produced by a recipe run.
org.openrewrite.table.SourcesFileErrors - Recipe performanceStatistics used in analyzing the performance of recipes.
org.openrewrite.table.RecipeRunStats