avro
avro copied to clipboard
AVRO-3579: Migrate to JUnit 5
AVRO-3579 : migration to JUnit5 using 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
plus fix bugs generated by it. Some unit test are still in JUnit4, and will be changed in another PR.
Some test, like TestSchemaValidation.testSchemaCompatibilityFailures were fixed, this one, currently in JUnit4 run only first step of the for loop (So, most of them are ignored)
You might also want to consider running this additional recipe to strip test
prefix from test method names.
mvn org.openrewrite.maven:rewrite-maven-plugin:4.32.0:run \
-Drewrite.recipeArtifactCoordinates=org.openrewrite.recipe:rewrite-testing-frameworks:1.26.1 \
-DactiveRecipes=org.openrewrite.java.testing.cleanup.RemoveTestPrefix
This prefix was required in JUnit 3, but is no longer needed; it gives a push towards better test method names.
rewrite-maven-plugin Done, but with manual fixes because some tests named testHashCode, or testToString can't be renamed without "test", some tests have "extends" classes or other have explicit calls, and testStaticMethode can't be renamed to staticMethod.
Done, but with manual fixes because some tests named testHashCode, or testToString can't be renamed without "test", some tests have "extends" classes or other have explicit calls, and testStaticMethode can't be renamed to staticMethod.
You're absolutely right; sorry for the inconvenience; these issues have already been solved, but we're still waiting on a new release. I expect one soon though :crossed_fingers:.