Back to Intellij Community

ReplaceAssertBooleanWithAssertEquality

plugins/kotlin/code-insight/descriptions/resources-en/inspectionDescriptions/ReplaceAssertBooleanWithAssertEquality.html

2025.3-rc-2328 B
Original Source

Reports calls to assertTrue() and assertFalse() that can be replaced with assert equality functions.

assertEquals(), assertSame(), and their negating counterparts (-Not-) provide more informative messages on failure.

Example:

assertTrue(a == b)

After the quick-fix is applied:

assertEquals(a, b)