Convert try-catch-fail blocks to AssertJ's assertThatThrownBy

MSAL

Replace try-catch blocks where the try block ends with a fail() statement and the catch block optionally contains assertions, with AssertJ's assertThatThrownBy().

org.openrewrite.java.testing.assertj.JUnitTryFailToAssertThatThrownBy
mod run . --recipe=org.openrewrite.java.testing.assertj.JUnitTryFailToAssertThatThrownBy

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