Inspectopedia
 
2024.3

'assertEquals()' called on array

Warning
Reliability
New
Last modified: 03 December 2024

Reports JUnit assertEquals() calls with arguments of an array type. Such methods compare the arrays' identities instead of the arrays' contents. Array contents should be checked with the assertArrayEquals() method.

Example:

After the quick-fix is applied: