Use MatcherAssert#assertThat(..)

MSAL

JUnit 4's Assert#assertThat(..) was deprecated in JUnit 4 and removed in JUnit Jupiter, so use Hamcrest's MatcherAssert#assertThat(..) instead.

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

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. Use static import org.hamcrest.MatcherAssert assertThat(..)