Use Assertions#assume*(..) and Hamcrest's MatcherAssume#assume*(..)

MSAL

Many of JUnit 4's Assume#assume(..) methods have no direct counterpart in JUnit 5 and require Hamcrest JUnit's MatcherAssume.

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

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 method target to static
  2. Reorder method arguments
  3. Transform Assume methods to Assumptions
  4. Change type Assume to Assumptions