Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Java API for performing tests on Applications integrating with Facebook
Java

This branch is 1 commit ahead, 2 commits behind jayway:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
facebook-test-java-api
.gitignore
CHANGELOG
LICENSE
README
pom.xml

README

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
Something went wrong with that request. Please try again.