Package net.sf.iqser.plugin.facebook

Examples of net.sf.iqser.plugin.facebook.IFacebookClientFactory


import net.sf.iqser.plugin.facebook.restfacebook.IFacebookRESTClient;

public class FacebookClientFactoryTest extends TestCase {

  public void test(){
    IFacebookClientFactory factory = new FacebookClientFactory();
    IFacebookRESTClient facebookApi = factory.createFacebookAPIClient("accessToken");
   
    assertNotNull(facebookApi);
  }
View Full Code Here


  public void testCanRead() throws IQserSecurityException{
   
    String fbItemId = "fbItemId1000";
    content.setContentUrl(URLUtils.makeContentURL(fbItemId, "Post"));
   
    IFacebookClientFactory mockFactory = EasyMock.createMock(IFacebookClientFactory.class);   
    // set private property using reflexion
    setPrivateField(securityFilter, "factory", mockFactory);
    IFacebookRESTClient mockClient = EasyMock.createMock(IFacebookRESTClient.class);
                   
    String accessToken = securityFilter.getUserAccessToken().get(user);       
    EasyMock.expect(mockFactory.createFacebookAPIClient(accessToken)).andReturn(mockClient);
    JsonObject jsonObject = new JsonObject();
    jsonObject.put("id", fbItemId);
    EasyMock.expect(mockClient.getObjectByID(fbItemId)).andReturn(jsonObject);
   
    EasyMock.replay(mockFactory, mockClient);
View Full Code Here

TOP

Related Classes of net.sf.iqser.plugin.facebook.IFacebookClientFactory

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.