@Test public void searchFacet() { mockServer.expect(requestTo( "https: + "&oauth2_access_token=ACCESS_TOKEN" )).andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("search.json", getClass()), MediaType.APPLICATION_JSON)); SearchParameters parameters = new SearchParameters(); parameters.setCountryCode("nl"); parameters.setKeywords("Java J2EE"); parameters.addFacet(SearchParameters.FacetType.LANGUAGE, SearchParameters.LANGUAGE_ENGLISH); parameters.addFacet(SearchParameters.FacetType.LANGUAGE, SearchParameters.LANGUAGE_GERMAN); parameters.addFacet(SearchParameters.FacetType.NETWORK, SearchParameters.NETWORK_FIRST_DEGREE); LinkedInProfiles result = linkedIn.profileOperations().search(parameters); assertEquals(0, result.getStart()); assertEquals(10, result.getCount()); assertEquals(110, result.getTotal()); assertEquals(10, result.getPeople().size()); assertProfile(result.getPeople().get(0), "YeagNX-lsX", "IT Consultant at Harvey Nash PLC", "Michelle", "Daly", "Staffing and Recruiting", null); }
public LinkedInProfiles search(SearchParameters parameters) { JsonNode node = restOperations.getForObject(expand(PEOPLE_SEARCH_URL, parameters), JsonNode.class); try { return objectMapper.reader(LinkedInProfiles.class).readValue(node.path("people")); } catch (Exception e) { throw new RuntimeException(e); } }
ProfileTemplate extends AbstractTemplate implements ProfileOperations { public LinkedInProfiles search(SearchParameters parameters) { JsonNode node = restOperations.getForObject(expand(PEOPLE_SEARCH_URL, parameters), JsonNode.class); try { return objectMapper.reader(LinkedInProfiles.class).readValue(node.path("people")); } catch (Exception e) { throw new RuntimeException(e); } } }
ProfileTemplate extends AbstractTemplate implements ProfileOperations { public LinkedInProfiles search(SearchParameters parameters) { JsonNode node = restOperations.getForObject(expand(PEOPLE_SEARCH_URL, parameters), JsonNode.class); try { return objectMapper.reader(LinkedInProfiles.class).readValue(node.path("people")); } catch (Exception e) { throw new RuntimeException(e); } } ProfileTemplate(RestOperations restOperations, ObjectMapper objectMapper); }
ProfileTemplate extends AbstractTemplate implements ProfileOperations { public LinkedInProfiles search(SearchParameters parameters) { JsonNode node = restOperations.getForObject(expand(PEOPLE_SEARCH_URL, parameters), JsonNode.class); try { return objectMapper.reader(LinkedInProfiles.class).readValue(node.path("people")); } catch (Exception e) { throw new RuntimeException(e); } } ProfileTemplate(RestOperations restOperations, ObjectMapper objectMapper); String getProfileId(); String getProfileUrl(); LinkedInProfile getUserProfile(); LinkedInProfileFull getUserProfileFull(); LinkedInProfile getProfileById(String id); LinkedInProfile getProfileByPublicUrl(String url); LinkedInProfileFull getProfileFullById(String id); LinkedInProfileFull getProfileFullByPublicUrl(String url); LinkedInProfiles search(SearchParameters parameters); }
ProfileTemplate extends AbstractTemplate implements ProfileOperations { public LinkedInProfiles search(SearchParameters parameters) { JsonNode node = restOperations.getForObject(expand(PEOPLE_SEARCH_URL, parameters), JsonNode.class); try { return objectMapper.reader(LinkedInProfiles.class).readValue(node.path("people")); } catch (Exception e) { throw new RuntimeException(e); } } ProfileTemplate(RestOperations restOperations, ObjectMapper objectMapper); String getProfileId(); String getProfileUrl(); LinkedInProfile getUserProfile(); LinkedInProfileFull getUserProfileFull(); LinkedInProfile getProfileById(String id); LinkedInProfile getProfileByPublicUrl(String url); LinkedInProfileFull getProfileFullById(String id); LinkedInProfileFull getProfileFullByPublicUrl(String url); LinkedInProfiles search(SearchParameters parameters);  }