codegenomeproject
Search
MarketplaceModules
PackagesCLIMCP
Sign in
  1. Marketplace
  2. Java
  3. Testing
  4. Clean up assertions

Clean up assertions

MSAL

Simplifies JUnit Jupiter assertions to their most-direct equivalents.

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

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.

Recipe
  1. Replace JUnit assertTrue(!<boolean>) to assertFalse(<boolean>)
  2. Replace JUnit assertFalse(!<boolean>) to assertTrue(<boolean>)
  3. Replace JUnit assertTrue(a.equals(b)) to assertEquals(a,b)
  4. Replace JUnit assertTrue(a == b) with assertEquals(a, b)
  5. Replace JUnit assertFalse(a.equals(b)) to assertNotEquals(a,b)
  6. assertEquals(a, null) to assertNull(a)
  7. Replace JUnit assertFalse(a == null) to assertNotNull(a)
  8. Replace JUnit assertTrue(a == null) to assertNull(a)
  9. Replace JUnit assertEquals(false, <boolean>) to assertFalse(<boolean>) / assertTrue(<boolean>)
  10. Replace JUnit assertNotEquals(false, <boolean>) to assertFalse(<boolean>) / assertTrue(<boolean>)
  11. Assertion arguments should be passed in the correct order
© Moderne, 2026
Recipe indexPrivacyTerms