Replace your code
Code:
@Test public void tests() { //GenericXmlApplicationContext allows me to load locations and refresh GenericXmlApplicationContext gctx = new GenericXmlApplicationContext();//I don't know how to create it from the previous ctx //Manage the active profiles in the Environment gctx.load("classpath*:META-INF/spring/integration/applicationContext*.xml"); gctx.refresh(); }
with this
Code:
@Test public void tests() { ClassPathXmlApplicationContext gctx = new ClassPathXmlApplicationContext("classpath*:META-INF/spring/integration/applicationContext*.xml", ctx); gctx.refresh(); }
This should create a new context with the parent context predefined from ctx instance.