Code example for ConfigurableApplicationContext

Methods: getBeanFactory

0
			testContext.setAttribute(RESET_REQUEST_CONTEXT_HOLDER_ATTRIBUTE, Boolean.TRUE); 
 
			if (wac instanceof ConfigurableApplicationContext) { 
				@SuppressWarnings("resource") 
				ConfigurableApplicationContext configurableApplicationContext = (ConfigurableApplicationContext) wac; 
				ConfigurableListableBeanFactory bf = configurableApplicationContext.getBeanFactory(); 
				bf.registerResolvableDependency(MockHttpServletResponse.class, response); 
				bf.registerResolvableDependency(ServletWebRequest.class, servletWebRequest); 
			} 
		} 
	} 
 
}