Inspectopedia Help

Assert boolean could be replaced with assert equality

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)

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Kotlin, @snapshot@

Last modified: 13 July 2023