NetworkUpdateTemplate extends AbstractTemplate implements NetworkUpdateOperations { public CurrentShare getCurrentShare() { return restOperations.getForObject(CURRENT_SHARE_URL, UpdateContentShare.class).getCurrentShare(); } NetworkUpdateTemplate(RestOperations restOperations); List<LinkedInNetworkUpdate> getNetworkUpdates(); List<LinkedInNetworkUpdate> getNetworkUpdates(int start, int count); List<LinkedInNetworkUpdate> getNetworkUpdates(NetworkUpdateParameters parameters); List<Comment> getNetworkUpdateComments(String updateKey); void createNetworkUpdate(String update); CurrentShare getCurrentShare(); URI share(NewShare share); void likeNetworkUpdate(String updateKey); void unlikeNetworkUpdate(String updateKey); void commentOnNetworkUpdate(String updateKey, String comment); List<LinkedInProfile> getNetworkUpdateLikes(String updateKey); String getNetworkUpdatesJson(NetworkUpdateParameters parameters); static final int DEFAULT_START; static final int DEFAULT_COUNT; }
@Test public void getCurrentShare() { mockServer.expect(requestTo("https: .andRespond(withSuccess(new ClassPathResource("current.json", getClass()), MediaType.APPLICATION_JSON)); CurrentShare share = linkedIn.networkUpdateOperations().getCurrentShare(); assertShare(share, "s702970589", "connections-only", "LINKEDIN", null, null, null, "It's not sexy but ..."); assertProfile(share.getAuthor(), "UB2kruYmAL", null, "Robert", "Drysdale", null, null); }