Hi i have an web application unsing spring and hibernate. I'm looking for a possiblity to call some startup functions which are executed when running tests, too.
I uste the AbstractTransactionalJUnit4SpringContextTests class and tried the following interfaces
but none of them is called under junit.
Any tips (hibernate-database-acces should be available at this time)?
My solution: ApplicationContextAware, just add a class to your classpath:
public class SpringApplicationContext implements ApplicationContextAware {
private static ApplicationContext CONTEXT;
public void setApplicationContext(ApplicationContext context) throws BeansException {
CONTEXT = context;
// DO DB INIT STUFF
}