Open GoogleCodeExporter opened 8 years ago
Not sure if it's possible to fix because mock.equals() is used internally in
Mockito. We'll have look but I cannot promise it will be fixed :)
Thanks for reporting!
Original comment by szcze...@gmail.com
on 7 Apr 2011 at 9:03
Issue 305 has been merged into this issue.
Original comment by brice.du...@gmail.com
on 24 Dec 2011 at 9:18
This bug is realy a PITA when you have stored the original object in a HashMap
and you want to access the value by your spy! The object overwrites hashCode
and equals and both simply delegate to the internal name field. Why cannot the
spy simply delegate hashCode and equals to the original object?
Original comment by corneliu...@googlemail.com
on 13 Mar 2014 at 9:49
Because a spy is a kind of mock, and two spy may not be the same nor equals
while their internal values may be the same.
Also the rule of thumb is to don't mock value objects ! Instead I'd rather not
use builders to make those value objects. If not possible then it means the
code has a design problem.
And this has the benefit of not being caught by this spy tradeoff.
Original comment by brice.du...@gmail.com
on 13 Mar 2014 at 2:13
Original issue reported on code.google.com by
ivankob...@gmail.com
on 24 Jan 2011 at 1:44