Open GoogleCodeExporter opened 8 years ago
In general, I would recommend using an ArgumentCaptor and trying to make the
test assert only on the state that is interesting VS interrogating the entire
object via reflection.
If the construction of the complex parameter happens in a mocked method it can
be refactored out to a separate factory.
Thanks a lot for feedback. I don't think we'll schedule work on deep ref equals
in near time. This might be a good case for a separate library that contains
reflection-powered Mockito matchers. You can also look up the web, perhaps
there are already some hamcrest matcher implementations that solve your use
case.
Hope that helps!
Original comment by szcze...@gmail.com
on 12 Oct 2012 at 7:41
Thanks. I think it helps very much. It's exactly what I need. I wasn't aware of
ArgumentCaptors in Mockito. I will try it out first thing next Monday. :-)
Original comment by tonnitie...@gmail.com
on 12 Oct 2012 at 7:48
Using ArgumentCaptor and Fest-Assert is fantastic :)
Plus they are on github, and they listen to their users as well !
Original comment by brice.du...@gmail.com
on 12 Oct 2012 at 8:00
Original comment by brice.du...@gmail.com
on 23 Oct 2012 at 8:51
Original comment by brice.du...@gmail.com
on 2 Dec 2012 at 10:16
Original issue reported on code.google.com by
tonnitie...@gmail.com
on 3 Oct 2012 at 12:18