Code example for ServletWebRequest

0
		paramNamedCookie = new MethodParameter(method, 0); 
		paramNamedDefaultValueString = new MethodParameter(method, 1); 
		paramString = new MethodParameter(method, 2); 
 
		request = new MockHttpServletRequest(); 
		webRequest = new ServletWebRequest(request, new MockHttpServletResponse()); 
	} 
 
	@Test 
	public void supportsParameter() { 
		assertTrue("Cookie parameter not supported", resolver.supportsParameter(paramNamedCookie)); 
		assertTrue("Cookie string parameter not supported", resolver.supportsParameter(paramNamedDefaultValueString)); 
		assertFalse("non-@CookieValue parameter supported", resolver.supportsParameter(paramString)); 
	} 
 
	@Test 
	public void resolveCookieDefaultValue() throws Exception { 
		Object result = resolver.resolveArgument(paramNamedDefaultValueString, null, webRequest, null); 
 
		assertTrue(result instanceof String); 
Experience pair programming with AI  Get Codota for Java