Code example for ServletWebRequest

0
		Method method = getClass().getMethod("params", Cookie.class, String.class); 
		cookieParameter = new MethodParameter(method, 0); 
		cookieStringParameter = new MethodParameter(method, 1); 
 
		request = new MockHttpServletRequest(); 
		webRequest = new ServletWebRequest(request, new MockHttpServletResponse()); 
	} 
 
	@Test 
	public void resolveCookieArgument() throws Exception { 
		Cookie expected = new Cookie("name", "foo"); 
		request.setCookies(expected); 
 
		Cookie result = (Cookie) resolver.resolveArgument(cookieParameter, null, webRequest, null); 
		assertEquals("Invalid result", expected, result); 
	} 
 
	@Test 
	public void resolveCookieStringArgument() throws Exception { 
		Cookie cookie = new Cookie("name", "foo");