Replace JUnit assertTrue(false) and assertFalse(true) with fail()

MSAL

Using fail is more direct and clear.

org.openrewrite.java.testing.cleanup.AssertLiteralBooleanToFailRecipes
mod run . --recipe=org.openrewrite.java.testing.cleanup.AssertLiteralBooleanToFailRecipes

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. Replace JUnit assertTrue(false, "reason") and assertFalse(true, "reason") with fail("reason")
  2. Replace JUnit assertTrue(false) and assertFalse(true) with fail()