Skip to content

jwb/facebook-test-java-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Java API for performing tests on Applications integrating with Facebook

Resources

License

Stars

Watchers

Forks

Packages

No packages published