Migrate System Rules to System Stubs and JUnit Pioneer

MSAL

Migrates the JUnit 4 rules of System Rules (com.github.stefanbirkner:system-rules) as part of the JUnit 4 to 5 migration. System property rules that only take string literals become JUnit Pioneer annotations; the other system property, environment variable, standard stream and standard input rules become System Stubs @SystemStub fields, and ExpectedSystemExit becomes System Stubs' catchSystemExit(..). Rules that can not be migrated get a TODO comment, and System Rules is only removed once nothing uses it.

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

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. Migrate JUnit 4 environmentVariables rule to JUnit 5 system stubs extension
  2. Migrate System Rules system property rules to JUnit Pioneer annotations
  3. Migrate System Rules to System Stubs
  4. Migrate System Rules ExpectedSystemExit to System Stubs catchSystemExit(..)
  5. Update dependencies for the System Rules migration