com.jayway.facebooktestjavaapi.testuser.impl
Class HttpClientFacebookTestUserAccount

java.lang.Object
  extended by com.jayway.facebooktestjavaapi.testuser.impl.HttpClientFacebookTestUserAccount
All Implemented Interfaces:
FacebookTestUserAccount

public class HttpClientFacebookTestUserAccount
extends Object
implements FacebookTestUserAccount

A FacebookTestUserAccount implementation that relies on HttpClientFacebookTestUserStore.


Constructor Summary
HttpClientFacebookTestUserAccount(HttpClientFacebookTestUserStore helper, org.json.simple.JSONObject user)
           
 
Method Summary
 String accessToken()
           
 void copyToOtherApplication(String applicationId, String accessToken, boolean appInstalled, String permissions)
          Copies this test user to another application
 void delete()
          Deletes this test user in Facebook.
 String getBooks()
           
 String getCheckins()
           
 String getEvents()
           
 String getFriends()
           
 String getGroups()
           
 String getLikes()
           
 String getMovies()
           
 String getMusic()
           
 String getNewsFeed()
           
 String getNotes()
           
 String getPhotoAlbums()
           
 String getPhotoTags()
           
 String getProfileFeed()
           
 String getUserDetails()
           
 String getVideoTags()
           
 String getVideoUploads()
           
 String id()
           
 String json()
           
 String loginUrl()
          The login URL gives access to the Facebook page for this test user.
 void makeFriends(FacebookTestUserAccount friend)
          Creates a friend relationship between this test user and the one in the parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientFacebookTestUserAccount

public HttpClientFacebookTestUserAccount(HttpClientFacebookTestUserStore helper,
                                         org.json.simple.JSONObject user)
Method Detail

delete

public void delete()
Description copied from interface: FacebookTestUserAccount
Deletes this test user in Facebook.

Specified by:
delete in interface FacebookTestUserAccount

copyToOtherApplication

public void copyToOtherApplication(String applicationId,
                                   String accessToken,
                                   boolean appInstalled,
                                   String permissions)
Description copied from interface: FacebookTestUserAccount
Copies this test user to another application

Specified by:
copyToOtherApplication in interface FacebookTestUserAccount
Parameters:
applicationId - The application ID of the other application
accessToken - The access token for the other application
appInstalled - Set to true to have the user automatically accept permissions requested from other application
permissions - The permissions the other application is requesting.

makeFriends

public void makeFriends(FacebookTestUserAccount friend)
Description copied from interface: FacebookTestUserAccount
Creates a friend relationship between this test user and the one in the parameter.

Specified by:
makeFriends in interface FacebookTestUserAccount
Parameters:
friend - A Facebook test user account.

getFriends

public String getFriends()
Specified by:
getFriends in interface FacebookTestUserAccount
Returns:
A JSON string array of /me/friends

getProfileFeed

public String getProfileFeed()
Specified by:
getProfileFeed in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/feed

getNewsFeed

public String getNewsFeed()
Specified by:
getNewsFeed in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/home

getLikes

public String getLikes()
Specified by:
getLikes in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/likes

getMovies

public String getMovies()
Specified by:
getMovies in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/movies

getMusic

public String getMusic()
Specified by:
getMusic in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/music

getBooks

public String getBooks()
Specified by:
getBooks in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/books

getNotes

public String getNotes()
Specified by:
getNotes in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/notes

getPhotoTags

public String getPhotoTags()
Specified by:
getPhotoTags in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/photos

getPhotoAlbums

public String getPhotoAlbums()
Specified by:
getPhotoAlbums in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/albums

getVideoTags

public String getVideoTags()
Specified by:
getVideoTags in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/videos

getVideoUploads

public String getVideoUploads()
Specified by:
getVideoUploads in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/videos/uploaded

getEvents

public String getEvents()
Specified by:
getEvents in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/events

getGroups

public String getGroups()
Specified by:
getGroups in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/groups

getCheckins

public String getCheckins()
Specified by:
getCheckins in interface FacebookTestUserAccount
Returns:
The JSON string array of /ID/checkins

getUserDetails

public String getUserDetails()
Specified by:
getUserDetails in interface FacebookTestUserAccount
Returns:
A JSON string containing user details for this test user (/me)

id

public String id()
Specified by:
id in interface FacebookTestUserAccount
Returns:
The Facebook ID for this test user

accessToken

public String accessToken()
Specified by:
accessToken in interface FacebookTestUserAccount
Returns:
The access token for this test user.

loginUrl

public String loginUrl()
Description copied from interface: FacebookTestUserAccount
The login URL gives access to the Facebook page for this test user.

The Facebook documentation states that the URL expires after first use or after 10 minutes, whichever comes first.

Specified by:
loginUrl in interface FacebookTestUserAccount
Returns:
The login URL for this test user.

json

public String json()
Specified by:
json in interface FacebookTestUserAccount
Returns:
The JSON string representation of the id, access token and login URL.


Copyright © 2011. All Rights Reserved.