Clean up assertions
MSALSimplifies JUnit Jupiter assertions to their most-direct equivalents.
org. openrewrite. java. testing. junit5. CleanupAssertionsmod run . --recipe= org. openrewrite. java. testing. junit5. CleanupAssertionsInstall 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.
- Replace JUnit
assertTrue(!<boolean>)toassertFalse(<boolean>) - Replace JUnit
assertFalse(!<boolean>)toassertTrue(<boolean>) - Replace JUnit
assertTrue(a.equals(b))toassertEquals(a,b) - Replace JUnit
assertTrue(a == b)withassertEquals(a, b) - Replace JUnit
assertFalse(a.equals(b))toassertNotEquals(a,b) assertEquals(a, null)toassertNull(a)- Replace JUnit
assertFalse(a == null)toassertNotNull(a) - Replace JUnit
assertTrue(a == null)toassertNull(a) - Replace JUnit
assertEquals(false, <boolean>)toassertFalse(<boolean>)/assertTrue(<boolean>) - Replace JUnit
assertNotEquals(false, <boolean>)toassertFalse(<boolean>)/assertTrue(<boolean>) - Assertion arguments should be passed in the correct order