@Test public void getPostComments() { mockServer.expect(requestTo((GroupTemplate.GROUP_POST_COMMENTS_URL + "?oauth2_access_token=ACCESS_TOKEN").replaceFirst("\\{post-id\\}", "g-46964-S-87679641"))).andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("group_post_comments.json", getClass()), MediaType.APPLICATION_JSON)); PostComments comments = linkedIn.groupOperations().getPostComments("g-46964-S-87679641"); assertEquals(5, comments.getCount()); assertEquals(0, comments.getStart()); assertEquals(10, comments.getTotal()); assertEquals(5, comments.getComments().size()); PostComment c = comments.getComments().get(0); assertEquals("g-4253322-S-89528249-64901084", c.getId()); assertEquals(new Date(1325749391000l), c.getCreationTimestamp()); assertProfile(c.getCreator(), null, null, "Piotr", "H.", null, null); assertEquals("https: c = comments.getComments().get(1); assertEquals("g-4253322-S-89528249-64901084", c.getId()); assertEquals(new Date(1325749913000l), c.getCreationTimestamp()); assertProfile(c.getCreator(), null, null, "Gaurav", "D.", null, null); assertEquals("Thanks Piotr.", c.getText()); }
public PostComments getPostComments(String postId) { return restOperations.getForObject(GROUP_POST_COMMENTS_URL, PostComments.class, postId); }
GroupTemplate extends AbstractTemplate implements GroupOperations { public PostComments getPostComments(String postId) { return restOperations.getForObject(GROUP_POST_COMMENTS_URL, PostComments.class, postId); } }
GroupTemplate extends AbstractTemplate implements GroupOperations { public PostComments getPostComments(String postId) { return restOperations.getForObject(GROUP_POST_COMMENTS_URL, PostComments.class, postId); } GroupTemplate(RestOperations restOperations); }
GroupTemplate extends AbstractTemplate implements GroupOperations { public PostComments getPostComments(String postId) { return restOperations.getForObject(GROUP_POST_COMMENTS_URL, PostComments.class, postId); } GroupTemplate(RestOperations restOperations); Group getGroupDetails(Integer id); GroupMemberships getGroupMemberships(); GroupMemberships getGroupMemberships(int start, int count); GroupSuggestions getGroupSuggestions(); GroupSuggestions getGroupSuggestions(int start, int count); GroupPosts getPosts(Integer groupId); GroupPosts getPosts(Integer groupId, int start, int count); PostComments getPostComments(String postId); PostComments getPostComments(String postId, int start, int count); void joinGroup(Integer groupId); void leaveGroup(Integer groupId); URI createPost(Integer groupId, String title, String summary); void likePost(String postId); void unlikePost(String postId); void followPost(String postId); void unfollowPost(String postId); void flagPostAsJob(String postId); void flagPostAsPromotion(String postId); void deleteOrFlagPostAsInappropriate(String postId); void addCommentToPost(String postId, String text); void deleteOrFlagCommentAsInappropriate(String commentId); void deleteGroupSuggestion(Integer groupId); }
GroupTemplate extends AbstractTemplate implements GroupOperations { public PostComments getPostComments(String postId) { return restOperations.getForObject(GROUP_POST_COMMENTS_URL, PostComments.class, postId); } GroupTemplate(RestOperations restOperations); Group getGroupDetails(Integer id); GroupMemberships getGroupMemberships(); GroupMemberships getGroupMemberships(int start, int count); GroupSuggestions getGroupSuggestions(); GroupSuggestions getGroupSuggestions(int start, int count); GroupPosts getPosts(Integer groupId); GroupPosts getPosts(Integer groupId, int start, int count); PostComments getPostComments(String postId); PostComments getPostComments(String postId, int start, int count); void joinGroup(Integer groupId); void leaveGroup(Integer groupId); URI createPost(Integer groupId, String title, String summary); void likePost(String postId); void unlikePost(String postId); void followPost(String postId); void unfollowPost(String postId); void flagPostAsJob(String postId); void flagPostAsPromotion(String postId); void deleteOrFlagPostAsInappropriate(String postId); void addCommentToPost(String postId, String text); void deleteOrFlagCommentAsInappropriate(String commentId); void deleteGroupSuggestion(Integer groupId); static final String BASE_URL; static final String BASE_PEOPLE_URL; static final String GROUP_BASE_URL; static final String GROUP_POSTS_BASE_URL; static final String GROUP_DETAILS_URL; static final String GROUP_JOIN_LEAVE_URL; static final String GROUP_MEMBERSHIPS_URL; static final String GROUP_SUGGESTIONS_URL; static final String GROUP_SUGGESTION_DELETE_URL; static final String GROUP_POSTS_URL; static final String GROUP_POST_COMMENTS_URL; static final String GROUP_CREATE_POST_URL; static final String GROUP_POST_LIKE_URL; static final String GROUP_POST_FOLLOW_URL; static final String GROUP_POST_FLAG_URL; static final String GROUP_POST_DELETE_URL; static final String GROUP_POST_ADD_COMMENT_URL; static final String GROUP_POST_DELETE_COMMENT_URL; }