public void testState() throws MalformedURLException, RequiresHttpAction { BaseOAuth20StateClient client = new FacebookClient(KEY, SECRET); client.setCallbackUrl(CALLBACK_URL); client.setState("OK"); URL url = new URL(client.getRedirectAction(MockWebContext.create()).getLocation()); assertTrue(url.getQuery().contains("state=OK")); }