I am using junit 4.11 and spring-test-4.1.5 for writing integration test cases. I am using @ContextConfiguration annotation to load the configurations.like,
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes ={ApplicationConfig.class,SpringConfiguration.class }, initializers = {CustomProfileResolver.class, AppInitializer.class}, loader = SpringApplicationContextLoader.class)
As you can see i am using two configuration classes.
The problem i am facing is i want to load the SpringConfiguration.class
before ApplicationConfig.class
. I tried with reversing the order but it didn't worked. Neither @order can be specified here.
So how to order the loading of these configuration classes, is it possible ?
Use @ContextHierarchy