BeanInitializer: wiring dependencies in unit tests
One of the things that irritates me the most about unit testing some classes in a Spring context, is initialising them with all their dependencies. This is especially true of Spring framework extensions, like FactoryBean implementations or *Aware implementations. It is cumbersome to add all the dependencies, and easy to forget to call the bean lifecycle methods, like the afterPropertiesSet method from InitializingBean.
The Spring base classes for unit testing help quite a lot, but there are still some things that are fiddly. E.g. in many cases it is necessary to disambiguate autowiring, so…