ConnectionTemplate implements ConnectionOperations { public List<LinkedInProfile> getConnections() { LinkedInConnections connections = restOperations.getForObject(URIBuilder.fromUri(CONNECTIONS_URL).build(), LinkedInConnections.class); return connections.getConnections(); } ConnectionTemplate(RestOperations restOperations); List<LinkedInProfile> getConnections(); List<LinkedInProfile> getConnections(int start, int count); NetworkStatistics getNetworkStatistics();  }
@Test public void getConnections() { mockServer.expect(requestTo("https: .andRespond(withSuccess(new ClassPathResource("connections.json", getClass()), MediaType.APPLICATION_JSON)); List<LinkedInProfile> connections = linkedIn.connectionOperations().getConnections(); assertConnections(connections); }
@Test public void getConnections_withStartAndCount() { mockServer.expect(requestTo("https: .andRespond(withSuccess(new ClassPathResource("connections.json", getClass()), MediaType.APPLICATION_JSON)); List<LinkedInProfile> connections = linkedIn.connectionOperations().getConnections(10, 20); assertConnections(connections); }