This content has been marked as final.
Show 1 reply
-
1. Re: Arquillian: inject WebApplicationContext
vbaghdas Dec 8, 2016 2:16 AM (in response to vbaghdas)I have solved the problem by creating the bean like this:
@Bean
public WebApplicationContext webApplicationContext() {
AnnotationConfigEmbeddedWebApplicationContext ctx = new AnnotationConfigEmbeddedWebApplicationContext();
StandardContext sCtx = new StandardContext();
StandardContext p1 = new StandardContext();
StandardEngine p2 = new StandardEngine();
p2.setService(new StandardService());
p1.setParent(p2);
sCtx.setParent(p1);
ctx.setServletContext(new ApplicationContextFacade(new ApplicationContext(sCtx)));
return ctx;
}