private TestSession.TestAccount createTestAccountAndFinishAuth() { Bundle localBundle = new Bundle(); localBundle.putString("installed", "true"); localBundle.putString("permissions", getPermissionsString()); localBundle.putString("access_token", getAppAccessToken()); if (mode == TestSession.Mode.SHARED) { localBundle.putString("name", String.format("Shared %s Testuser", new Object[] { getSharedTestAccountIdentifier() })); } Object localObject = new Request(null, String.format("%s/accounts/test-users", new Object[] { testApplicationId }), localBundle, HttpMethod.POST).executeAndWait(); FacebookRequestError localFacebookRequestError = ((Response)localObject).getError(); localObject = (TestSession.TestAccount)((Response)localObject).getGraphObjectAs(TestSession.TestAccount.class); if (localFacebookRequestError != null) { finishAuthOrReauth(null, localFacebookRequestError.getException()); return null; } assert (localObject != null); if (mode == TestSession.Mode.SHARED) { ((TestSession.TestAccount)localObject).setName(localBundle.getString("name")); storeTestAccount((TestSession.TestAccount)localObject); } finishAuthWithTestAccount((TestSession.TestAccount)localObject); return (TestSession.TestAccount)localObject; }
private static void populateTestAccounts(Collection<TestSession.TestAccount> paramCollection, GraphObject paramGraphObject) { try { paramCollection = paramCollection.iterator(); while (paramCollection.hasNext()) { TestSession.TestAccount localTestAccount = (TestSession.TestAccount)paramCollection.next(); localTestAccount.setName(((GraphUser)paramGraphObject.getPropertyAs(localTestAccount.getId(), GraphUser.class)).getName()); storeTestAccount(localTestAccount); } } finally {} }