NetworkUpdateTemplate extends AbstractTemplate implements NetworkUpdateOperations { public List<LinkedInNetworkUpdate> getNetworkUpdates() { NetworkUpdateParameters parameters = new NetworkUpdateParameters( null, false, DEFAULT_START, DEFAULT_COUNT, null, null, true, false, Collections.<UpdateTypeInput>emptyList()); return getNetworkUpdates(parameters); } 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 getUpdates() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("updates.json", getClass()), MediaType.APPLICATION_JSON)); List<LinkedInNetworkUpdate> updates = linkedIn.networkUpdateOperations().getNetworkUpdates(); assertUpdates(updates); }
@Test public void getUpdates_withStartAndCount() { mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("updates.json", getClass()), MediaType.APPLICATION_JSON)); List<LinkedInNetworkUpdate> updates = linkedIn.networkUpdateOperations().getNetworkUpdates(10, 30); assertUpdates(updates); }