Package com.restfb.types

Examples of com.restfb.types.Note


    arrayParams[1] = Parameter.with("message","note message");   
    FacebookType mockFbType = EasyMock.createMock(FacebookType.class);
    expect(mockFbClient.publishObject(connection, FacebookType.class, arrayParams)).andReturn(mockFbType);   
    expect(mockFbType.getId()).andReturn("122788341354");
   
    Note expectedNote = loadObjectFromJSON("/examples/note.json",Note.class);
    expect(mockFbClient.getFacebookObjectByID("122788341354", Note.class)).andReturn(expectedNote);
    //note comments   
    expect(mockFbClient.getFacebookConnectionByID("122788341354/comments", Comment.class)).andReturn(new ArrayList<Comment>());
    //note likes
    expect(mockFbClient.getFacebookConnectionByID("122788341354/likes", NamedFacebookType.class)).andReturn(new ArrayList<NamedFacebookType>());
View Full Code Here


   *     the content url
   * @return a {#link=Content} object
   */
  public Content getContent(String contentURL) {
    String fbid = URLUtils.getFbId(contentURL);
    Note note = getFbClient().getFacebookObjectByID(fbid, Note.class);

    Content content = note2Content(note);
    content.setContentUrl(contentURL);

    // the API does not retrieve comments and likes
    // add comments
    List<Comment> noteComments = getFbClient().getFacebookConnectionByID(
        note.getId() + "/comments", Comment.class);
    addComments(content, noteComments);

    // add likes
    List<NamedFacebookType> likes = getFbClient().getFacebookConnectionByID(
        note.getId() + "/likes", NamedFacebookType.class);
    addLikes(content, likes);

    return content;
  }
View Full Code Here

    expect(
        mockFbClient.publishObject(connection, FacebookType.class,
            arrayParams)).andReturn(mockFbType);
    expect(mockFbType.getId()).andReturn(fbid);

    Note expectedNote = loadObjectFromJSON("/examples/note.json",
        Note.class);
    expect(mockFbClient.getFacebookObjectByID(fbid, Note.class)).andReturn(
        expectedNote);
    // note comments
    expect(
View Full Code Here

  public void testGetContent() throws IOException {

    String fbid = "122788341354";
    String contentUrl = "facebook/accessTokenKey/" + fbid + "/note";

    Note expectedNote = loadObjectFromJSON("/examples/note.json",
        Note.class);

    // expected behavior
    expect(mockFbClient.getFacebookObjectByID(fbid, Note.class)).andReturn(
        expectedNote);
View Full Code Here

TOP

Related Classes of com.restfb.types.Note

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.