* After the test is finished, revoke the permission to the app so the login dialog appears again on the next login when running the test
* See https://developers.facebook.com/docs/facebook-login/permissions/v2.1#revokelogin
*/
@After
public void shutdown() {
final FacebookAuthUser authUser = (FacebookAuthUser) (MyTestUserServicePlugin.getLastAuthUser());
if (authUser == null) {
// in case the test failed, we don't have an authUser
return;
}
final String url = getConfig().getString("userInfoUrl") + "/permissions";
WS
.url(url)
.setQueryParameter(OAuth2AuthProvider.Constants.ACCESS_TOKEN, authUser.getOAuth2AuthInfo().getAccessToken())
.setQueryParameter("format", "json")
.setQueryParameter("method", "delete")
.get().get(10, TimeUnit.SECONDS);
}