Migrate Hamcrest JUnit's ExpectedException to AssertJ

MSAL

Hamcrest JUnit's ExpectedException is a copy of JUnit 4's rule that takes Hamcrest matchers. Migrate its uses to AssertJ's assertThatExceptionOfType(..), which also leaves the test independent of the JUnit 4 rule that removing Hamcrest JUnit would take off the classpath.

org.openrewrite.java.testing.hamcrest.MigrateHamcrestJUnitExpectedExceptionToAssertJ
mod run . --recipe=org.openrewrite.java.testing.hamcrest.MigrateHamcrestJUnitExpectedExceptionToAssertJ

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