Testing legacy code is tough. It was never designed for tests. The app uses EJBs including old fashioned entity beans. After spending some time trying to get a few tests written against a stateless session bean using MockEJB, I hit upon a new idea. Maybe I want to test at the Business Delegate layer and just mock the calls to the stateless session bean.
With a little dash of EasyMock and a bonus setter method to inject the stateless session bean I now can start opening up a seam for future tests. I’d still like to test the EJB layers, but now I have a seam in the application to work from. (Kudos to Michael Feathers for naming the technique)