@Test public void testGetAuthData() { Locale.setDefault(new Locale("ar")); TimeZone.setDefault(TimeZone.getTimeZone("PST")); FacebookController controller = new FacebookController(null); Calendar calendar = new GregorianCalendar(2015, 6, 3); Set<String> permissions = new HashSet<String>(); permissions.add("user_friends"); permissions.add("profile"); AccessToken accessToken = new AccessToken( "access_token", "application_id", "user_id", permissions, null, null, AccessTokenSource.DEVICE_AUTH, calendar.getTime(), null, null); Map<String, String> authData = controller.getAuthData(accessToken); assertEquals("user_id", authData.get("id")); assertEquals("access_token", authData.get("access_token")); assertEquals("2015-07-03T07:00:00.000Z", authData.get("expiration_date")); assertEquals("profile,user_friends", authData.get("permissions")); }
public Map<String, String> getAuthData(AccessToken accessToken) { Map<String, String> authData = new HashMap<>(); authData.put(KEY_USER_ID, accessToken.getUserId()); authData.put(KEY_ACCESS_TOKEN, accessToken.getToken()); authData.put(KEY_EXPIRATION_DATE, PRECISE_DATE_FORMAT.format(accessToken.getExpires())); authData.put(KEY_REFRESH_DATE, PRECISE_DATE_FORMAT.format(accessToken.getLastRefresh())); Set<String> permissionSet = accessToken.getPermissions(); String valueToInsert = TextUtils.join(",", permissionSet); authData.put(KEY_PERMISSIONS, valueToInsert); return authData; }
FacebookController { public Map<String, String> getAuthData(AccessToken accessToken) { Map<String, String> authData = new HashMap<>(); authData.put(KEY_USER_ID, accessToken.getUserId()); authData.put(KEY_ACCESS_TOKEN, accessToken.getToken()); authData.put(KEY_EXPIRATION_DATE, PRECISE_DATE_FORMAT.format(accessToken.getExpires())); authData.put(KEY_REFRESH_DATE, PRECISE_DATE_FORMAT.format(accessToken.getLastRefresh())); Set<String> permissionSet = accessToken.getPermissions(); String valueToInsert = TextUtils.join(",", permissionSet); authData.put(KEY_PERMISSIONS, valueToInsert); return authData; } }
FacebookController { public Map<String, String> getAuthData(AccessToken accessToken) { Map<String, String> authData = new HashMap<>(); authData.put(KEY_USER_ID, accessToken.getUserId()); authData.put(KEY_ACCESS_TOKEN, accessToken.getToken()); authData.put(KEY_EXPIRATION_DATE, PRECISE_DATE_FORMAT.format(accessToken.getExpires())); authData.put(KEY_REFRESH_DATE, PRECISE_DATE_FORMAT.format(accessToken.getLastRefresh())); Set<String> permissionSet = accessToken.getPermissions(); String valueToInsert = TextUtils.join(",", permissionSet); authData.put(KEY_PERMISSIONS, valueToInsert); return authData; } FacebookController(FacebookSdkDelegate facebookSdkDelegate);   FacebookController(); }
FacebookController { public Map<String, String> getAuthData(AccessToken accessToken) { Map<String, String> authData = new HashMap<>(); authData.put(KEY_USER_ID, accessToken.getUserId()); authData.put(KEY_ACCESS_TOKEN, accessToken.getToken()); authData.put(KEY_EXPIRATION_DATE, PRECISE_DATE_FORMAT.format(accessToken.getExpires())); authData.put(KEY_REFRESH_DATE, PRECISE_DATE_FORMAT.format(accessToken.getLastRefresh())); Set<String> permissionSet = accessToken.getPermissions(); String valueToInsert = TextUtils.join(",", permissionSet); authData.put(KEY_PERMISSIONS, valueToInsert); return authData; } FacebookController(FacebookSdkDelegate facebookSdkDelegate);   FacebookController(); void initialize(Context context, int callbackRequestCodeOffset); boolean onActivityResult(int requestCode, int resultCode, Intent data); Task<Map<String, String>> authenticateAsync(
            Activity activity,
            Fragment fragment,
            LoginAuthorizationType authorizationType,
            Collection<String> permissions); Map<String, String> getAuthData(AccessToken accessToken); void setAuthData(Map<String, String> authData); }
FacebookController { public Map<String, String> getAuthData(AccessToken accessToken) { Map<String, String> authData = new HashMap<>(); authData.put(KEY_USER_ID, accessToken.getUserId()); authData.put(KEY_ACCESS_TOKEN, accessToken.getToken()); authData.put(KEY_EXPIRATION_DATE, PRECISE_DATE_FORMAT.format(accessToken.getExpires())); authData.put(KEY_REFRESH_DATE, PRECISE_DATE_FORMAT.format(accessToken.getLastRefresh())); Set<String> permissionSet = accessToken.getPermissions(); String valueToInsert = TextUtils.join(",", permissionSet); authData.put(KEY_PERMISSIONS, valueToInsert); return authData; } FacebookController(FacebookSdkDelegate facebookSdkDelegate);   FacebookController(); void initialize(Context context, int callbackRequestCodeOffset); boolean onActivityResult(int requestCode, int resultCode, Intent data); Task<Map<String, String>> authenticateAsync(
            Activity activity,
            Fragment fragment,
            LoginAuthorizationType authorizationType,
            Collection<String> permissions); Map<String, String> getAuthData(AccessToken accessToken); void setAuthData(Map<String, String> authData); static final int DEFAULT_AUTH_ACTIVITY_CODE; }