Dependency Injection for Unit Tests- July 17, 2004 Ever wanted Dependency Injection for your unit tests I got sick of doing context.getBean("thisDao") and context.getBean("thatDao") when testing my springified DAO classes. What I wanted was something like this: public class TestUserManagement extends BaseTestCase private UserDao userDao = null; public void testSomething() throws Exception userDao.createAdmin(); Note that I don't new any UserDao. I expect the DI container to instantiate it for...http://www.jroller.com/ara_e/entry/dependency_injection_for_unit_tests |