-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathREADME
36 lines (29 loc) · 1.2 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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