|
Project Information
Featured
Downloads
Links
|
The project is a Java API for performing tests on Applications integrating with Facebook. Part of this API manages Facebook test users for the application. Excerpt from the Facebook developer documentation about test users: "A test user is a user account associated with an app created for the purpose of testing the functionality of that application. You can use test users for manual or automated testing." Usage exampleFacebookTestUserStore facebookStore = new HttpClientFacebookTestUserStore("<appId>", "<appSecret>"));
FacebookTestUserAccount account = facebookStore.createTestUser(true, "email,read_stream");
systemUnderTest.doStuffThatIntegratesWithFacebook( account.accessToken() );
assertTrue("Wall did not contain expected data", account.getProfileFeed().contains("stuff posted on Wall"));Where appId and appSecret should be replaced with the information for your Facebook application. Supports creating friends connectionsFacebookTestUserStore facebookStore = new HttpClientFacebookTestUserStore("<appId>", "<appSecret>"));
FacebookTestUserAccount account1 = facebookStore.createTestUser(true, "email,read_stream");
FacebookTestUserAccount account2 = facebookStore.createTestUser(true, "email,read_stream");
account1.makeFriends(account2);Get user object informationaccount.getProfileFeed(); account.getFriends(); account.getMovies(); account.getEvents(); // etc. Copying a test user from an application to anothersince version 1.1.3 boolean acceptApplication = true;
account.copyToOtherApplication("<otherAppId>", "<otherAppSecret>", acceptApplication, "<facebook permissions>");since version 1.1.4 boolean acceptApplication = true; account.copyToTestUserStore(testUserStore, acceptApplication, "<facebook permissions>"); Use a pre-configured HttpClientsince version 1.1.5 HttpClient httpClient = new DefaultHttpClient();
// configuration of httpClient
// ...
FacebookTestUserStore facebookStore = new HttpClientFacebookTestUserStore("<appId>", "<appSecret>", httpClient));News
Documentation |