Migrate JUnit 4 lifecycle annotations to JUnit Jupiter

MSAL

Replace JUnit 4's @Before, @BeforeClass, @After, and @AfterClass annotations with their JUnit Jupiter equivalents.

org.openrewrite.java.testing.junit5.UpdateBeforeAfterAnnotations
mod run . --recipe=org.openrewrite.java.testing.junit5.UpdateBeforeAfterAnnotations

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Change type Before to BeforeEach
  2. Change type After to AfterEach
  3. Change type BeforeClass to BeforeAll
  4. Change type AfterClass to AfterAll