Bigpoint/facebook-test-java-api
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
Provides a Java API for testing Facebook application integration.
Short test example:
/**
* This is an example code of how to use the
* Facebook Test Java API for asserting
* that a system integrates with facebook
* correctly.
*/
public void FacebookApplicationSystemTest() {
@Test
public void a_user_should_have_a_new_wall_post() {
// Setup
FacebookTestUserAccount account = createAccount();
// Act
SystemIntegratingWithFacebook system = testContext.getSystem();
system.registerAccessTokenForUser( account.accessToken );
system.doStuffThatIntegratesWithFacebook();
// Assert
String wall = account.getProfileFeed();
// Use your favorite JSON parser/asserter framwork here
assertTrue("The post was not found on the wall", wall.contains("System has posted");
}
private FacebookTestUserAccount createAccount() {
facebookStore = new HttpClientFacebookTestUserStore("<appId>", "<appSecret>"));
return facebookStore.createTestUser(true, "read-stream,email");
}
}
Other examples may be found in the examples directory in the source code or go to
the project page: http://code.google.com/p/facebook-test-java-api