@Category(RealAPITests.class)
@Test
public void signinWithFacebook() throws Exception {
CookieHandler.setDefault(new ListCookieHandler());
Facebook facebook = new FacebookFactory().getInstance();
HttpClientImpl http = new HttpClientImpl();
HttpResponse response;
String oAuthAppId = p.getProperty("oauth.appId");
String oAuthAppSecret = p.getProperty("oauth.appSecret");
facebook.setOAuthAppId(oAuthAppId, oAuthAppSecret);
facebook.setOAuthPermissions("email");
// auth
String callbackURL = p.getProperty("login.callbackURL");
String authorizationURL = facebook.getOAuthAuthorizationURL(callbackURL);
response = http.get(authorizationURL);
// login
String loginURL = response.getResponseHeader("Location");
response = http.get(loginURL);