takimafr / spring-dbunit

DBUnit support for Spring
Apache License 2.0
40 stars 19 forks source link

How to load an dataset before spring context beans creations? #42

Open sandrocsimas opened 9 years ago

sandrocsimas commented 9 years ago

I have beans that load data from database inside @PostConstruct methods. In my tests i need to load the dataset before the creation of spring context beans. Is there any way to do this?

It seems that the follow code is not working correctly. The dataset is loaded after the spring context beans creation.

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:/WEB-INF/application-context.xml")
@TestExecutionListeners({ DataSetTestExecutionListener.class, DependencyInjectionTestExecutionListener.class })