An excellent article on Spring, AOP, EJBs and testing has been published on dev2dev.bea.com from Eugene Kuleshov. It’s intended for Spring newcomers and intermediate users. I have just read it and highly recommand it.
It deals with:
- Simplifying usage of EJB (SSB here) by delegating to Spring beans and how to inject Spring beans in EJBs
- Weaving application logic in Spring beans without modifying them using AOP
- Testing techniques by mocking beans which rely on infrastructure components with Junit and JMock
I wasn’t aware of using Spring’s BeanPostProcessor to switch beans at runtime which prevents from writing another applicationContext.xml file for testing.