Closed GoogleCodeExporter closed 8 years ago
Hi,
This is the expected behavior, as the injection is "automagical", Mockito
cannot infer what is safe to inject or not after the constructor injection
happened, so it is better to respect the work done by the constructor when CI
happen.
Aside of that it seems wrong design-wise to have constructor injection plus
setter injection (regardless of mockito). And it's even better to make this bad
design appear in the test, so we are more enclined to fix it. It's already
arguable to use or not the injection feature of mockito because you don't
always feel the pain of injecting collaborators.
That's the motivation behind this behavior, though I think this should be
better documented in the Javadoc
Cheers,
Brice
Original comment by brice.du...@gmail.com
on 23 May 2013 at 5:10
Original issue reported on code.google.com by
kan....@gmail.com
on 23 May 2013 at 10:41