Inspectopedia Help

'assertEquals()' between objects of inconvertible types

Reports calls to assertion methods where the "expected" and "actual" arguments are of incompatible types.

Such calls often indicate that there is a bug in the test. This inspection checks the relevant JUnit, TestNG, and AssertJ methods.


assertEquals("1", 1); assertNotSame(new int[0], 0); // weak warning, may just test the equals() contract assertThat(foo).as("user type").isNotEqualTo(bar);

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Java, 241.16690

Last modified: 29 April 2024