assertNull
/NotNull
instead of assertEquals
/notEquals
to assert nullity JAVA-W1091Use the assertNull
and assertNotNull
methods instead of using assertEquals
or assertNotEquals
with an expected null
argument.
This issue is raised when the Java analyzer detects a usage of assertEquals
or assertNotEquals
where one of the arguments is a null value.
Assertions.assertEquals(null, result);
Use the assertNull
and assertNotNull
methods instead:
Assertions.assertNull(result);