Cleanup
Composite Recipes
Recipes that include further recipes, often including the individual recipes below.
Recipes
- Assertion arguments should be passed in the correct order
- Include an assertion in tests
- Junit
assertTrue(a == b)
toassertEquals(a,b)
- Remove empty tests without comments
- Remove
public
visibility of JUnit 5 tests - Remove
test
prefix from JUnit 5 tests - Replace JUnit
assertEquals(false, <boolean>)
toassertFalse(<boolean>)
/assertTrue(<boolean>)
- Replace JUnit
assertFalse(!<boolean>)
toassertTrue(<boolean>)
- Replace JUnit
assertFalse(a == null)
toassertNotNull(a)
- Replace JUnit
assertFalse(a.equals(b))
toassertNotEquals(a,b)
- Replace JUnit
assertNotEquals(false, <boolean>)
toassertFalse(<boolean>)
/assertTrue(<boolean>)
- Replace JUnit
assertTrue(!<boolean>)
toassertFalse(<boolean>)
- Replace JUnit
assertTrue(a == null)
toassertNull(a)
- Replace JUnit
assertTrue(a.equals(b))
toassertEquals(a,b)
- Replace JUnit
assertTrue(false, "reason")
andassertFalse(true, "reason")
withfail("reason")
- Simplify
throws
statements of tests assertEquals(a, null)
toassertNull(a)