Migrate System Rules to System Stubs and JUnit Pioneer
MSALMigrates 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. MigrateSystemRulesmod run . --recipe= org. openrewrite. java. testing. junit5. MigrateSystemRulesInstall 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.
- Migrate JUnit 4 environmentVariables rule to JUnit 5 system stubs extension
- Migrate System Rules system property rules to JUnit Pioneer annotations
- Migrate System Rules to System Stubs
- Migrate System Rules
ExpectedSystemExitto System StubscatchSystemExit(..) - Update dependencies for the System Rules migration