Code example for GenericWebApplicationContext

Methods: getBeanFactory, refresh

0
 
	private NativeWebRequest webRequest; 
 
	@Before 
	public void setUp() throws Exception { 
		GenericWebApplicationContext context = new GenericWebApplicationContext(); 
		context.refresh(); 
		resolver = new RequestHeaderMethodArgumentResolver(context.getBeanFactory()); 
 
		Method method = getClass().getMethod("params", String.class, String[].class, String.class, String.class, Map.class); 
		paramNamedDefaultValueStringHeader = new MethodParameter(method, 0); 
		paramNamedValueStringArray = new MethodParameter(method, 1); 
		paramSystemProperty = new MethodParameter(method, 2); 
		paramContextPath = new MethodParameter(method, 3); 
		paramNamedValueMap = new MethodParameter(method, 4); 
 
		servletRequest = new MockHttpServletRequest(); 
		webRequest = new ServletWebRequest(servletRequest, new MockHttpServletResponse()); 
 
		// Expose request to the current thread (for SpEL expressions)