I would like to inject a Mockito mock object into a Spring (3+) bean for the purposes of unit testing with JUnit. My bean dependencies are currently injected by using the
The best way is:
Update In the context file this mock must be listed before any autowired field depending on it is declared.