Hi, I have a Controller that invokes a class who is using ContextLoaderListener as follow:
And then with static context I injects a bean as follow (it's an abstract class):Code:private static WebApplicationContext context= ContextLoaderListener.getCurrentWebApplicationContext();
This is working fine but when I run my controller test, even using @WebAppConfiguration annotation, context is null. I have injected in my test case WebApplicationContext with succeed (it is not null).Code:context.getAutowireCapableBeanFactory().autowireBean(this);
How can I use ContextLoaderListener in a test case or how can I replace it to get the current WebApplicationContext, even if I running a junit test?
Is possible that the webAppConfiguration is not loading? how can I be sure of that?
Thanks


Reply With Quote
