Spring test context setup without SpringJUnit4ClassRunner or AbstractJUnit4SpringContextTests (in Selenium testing) Spring test context setup without SpringJUnit4ClassRunner or AbstractJUnit4SpringContextTests (in Selenium testing) selenium selenium

Spring test context setup without SpringJUnit4ClassRunner or AbstractJUnit4SpringContextTests (in Selenium testing)


I was annoyed by a similar problem enough to write a MethodRule implementation that will load a Spring context and autowire it's host test. Maybe that is the start of what you're looking for.

It will allow you to do something like this:

@Rulepublic TemporarySpringContext context = new TemporarySpringContext("context.xml");@AutowiredMyService myServiceBean;

If you make any improvements please let me know.