ProfileTemplate extends AbstractTemplate implements ProfileOperations { public LinkedInProfile getProfileByPublicUrl(String url) { return getProfileByPublicUrl(url, PROFILE_FIELDS, LinkedInProfile.class); } 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);  }
@Test public void getProfileByPublicUrl() { mockServer.expect(requestTo(LinkedInTemplate.BASE_URL + "url=https%3A%2F%2Fwww.linkedin.com%2Fin%2Fhabuma" + ProfileTemplate.PROFILE_FIELDS + "&oauth2_access_token=ACCESS_TOKEN")) .andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("profile.json", getClass()), MediaType.APPLICATION_JSON)); LinkedInProfile profile = linkedIn.profileOperations().getProfileByPublicUrl("https: assertEquals("z37f0n3A05", profile.getId()); assertEquals("Just a guy", profile.getHeadline()); assertEquals("Craig", profile.getFirstName()); assertEquals("Walls", profile.getLastName()); assertEquals("Computer Software", profile.getIndustry()); assertEquals("https: assertEquals("https: assertEquals("https: }