Code example for ServletWebRequest

0
		paramNamedString = new MethodParameter(method, 0); 
		paramString = new MethodParameter(method, 1); 
 
		mavContainer = new ModelAndViewContainer(); 
		request = new MockHttpServletRequest(); 
		webRequest = new ServletWebRequest(request, new MockHttpServletResponse()); 
	} 
 
	@Test 
	public void supportsParameter() { 
		assertTrue("Parameter with @PathVariable annotation", resolver.supportsParameter(paramNamedString)); 
		assertFalse("Parameter without @PathVariable annotation", resolver.supportsParameter(paramString)); 
	} 
 
	@Test 
	public void resolveArgument() throws Exception { 
		Map<String, String> uriTemplateVars = new HashMap<String, String>(); 
		uriTemplateVars.put("name", "value"); 
		request.setAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE, uriTemplateVars);