Applies JUnit 5 assertThrows on last statement in lambda block only

MSAL

Applies JUnit 5 assertThrows on last statement in lambda block only. In rare cases may cause compilation errors if the lambda uses effectively non final variables. In some cases, tests might fail if earlier statements in the lambda block throw exceptions.

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

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