My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
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 example

FacebookTestUserStore 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 connections

FacebookTestUserStore 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 information

account.getProfileFeed();
account.getFriends();
account.getMovies();
account.getEvents();
// etc.

Copying a test user from an application to another

since 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 HttpClient

since version 1.1.5

HttpClient httpClient = new DefaultHttpClient();
// configuration of httpClient
// ...
FacebookTestUserStore facebookStore = new HttpClientFacebookTestUserStore("<appId>", "<appSecret>", httpClient));

News

  • 2011-10-19: facebook-test-java-api 1.1.5 is released.
    • Possibility to provide a HttpClient instance to HttpClientFacebookTestUserStore constructor.
    • Added example of using json-path when asserting data in facebook-test-java-api-itest.
    • Bugfix for NPE when calling facebookStore.createTestUser(false,"...").
  • 2011-03-28: facebook-test-java-api 1.1.4 is released.
  • 2011-03-25: facebook-test-java-api 1.1.3 is released.
    • Added functionality for copying test users from one application to another.
  • 2011-02-02: facebook-test-java-api 1.0 is released.

Documentation

Powered by Google Project Hosting