Currently I am doing some code review and I found this line of code which interrupts the testcase:
assertEquals(Long.valueOf(4321), lMessage.getNumber());
getNumber
returns an Integer
which is also 4321
.
I changed it to this:
assertTrue(4321 == lSavedStoerung.getMessage());
because in my understanding of the equals method the assertEquals
can never return true in the first example. With my assertTrue
all test cases running fine.
Or did I understand something wrong?