spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Switch remaining jUnit 4 tests to jUnit Jupiter

Open OlgaMaciaszek opened this issue 2 years ago • 3 comments

OlgaMaciaszek avatar Sep 16 '21 18:09 OlgaMaciaszek

Hi @OlgaMaciaszek, I would like to work on this issue.

shivakrishnaah avatar Sep 24 '21 06:09 shivakrishnaah

Hi @OlgaMaciaszek I would like to try this one

jenimal avatar Oct 01 '21 16:10 jenimal

So there was an earlier attempt in #2387 which broke down due to issues migrating the ModifiedClasspathRunner tests. Might I suggest we start fresh not with a complete migration, but instead with a phased migration? That way at least most of the tests can already adopt the new JUnit 5 constructs, while we run the remaining JUnit 4 tests through the vintage runner.

The majority of the migration could then be achieved through the following command:

mvn org.openrewrite.maven:rewrite-maven-plugin:4.27.0:run \
    -Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-testing-frameworks:1.24.0 \
    -DactiveRecipes=org.openrewrite.java.testing.junit5.JUnit5BestPractices

If you refrain from fixing failed tests (for now), and instead revert any test failures, that could mean the simple cases don't need much in terms of review.

Subsequent pull requests can than be added later that do actually need more thorough changes and review, before we fully remove the vintage runner from the classpath.

timtebeek avatar Jul 23 '22 17:07 timtebeek