Code example for ServletWebRequest

0
		resolver.resolveArgument(tokenParameter, request); 
	} 
 
	@Test 
	public void resolveArgument_noCookies_unrequired() throws Exception { 
		NativeWebRequest request = new ServletWebRequest(new MockHttpServletRequest()); 
		Method method = FacebookArgumentResolverTest.class.getDeclaredMethod("unrequiredAnnotatedMethod", String.class, 
				String.class, String.class); 
 
		MethodParameter idParameter = new MethodParameter(method, 0); 
		assertEquals(null, resolver.resolveArgument(idParameter, request)); 
 
		MethodParameter tokenParameter = new MethodParameter(method, 1); 
		assertEquals(null, resolver.resolveArgument(tokenParameter, request)); 
	} 
 
	@Test(expected = IllegalStateException.class) 
	public void resolveFacebookUserIdArgument_noFacebookCookie_required() throws Exception { 
		MockHttpServletRequest httpServletRequest = new MockHttpServletRequest(); 
		httpServletRequest.setCookies(new Cookie("not_a_facebook_cookie", "doesn't matter"));