ProfileTemplate extends AbstractTemplate implements ProfileOperations { public LinkedInProfileFull getUserProfileFull() { return getUserProfile(FULL_PROFILE_FIELDS, LinkedInProfileFull.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 getUserProfileFull() { mockServer.expect(requestTo(LinkedInTemplate.BASE_URL + "~" + ProfileTemplate.FULL_PROFILE_FIELDS + "&oauth2_access_token=ACCESS_TOKEN")).andExpect(method(GET)) .andRespond(withSuccess(new ClassPathResource("profile_full.json", getClass()), MediaType.APPLICATION_JSON)); LinkedInProfileFull profile = linkedIn.profileOperations().getUserProfileFull(); assertProfile(profile, "UB2kruYmAL", "Software Architect", "Robert", "Drysdale", "Telecommunications", null); assertEquals("Canoeing Ireland", profile.getAssociations()); assertEquals(1900, profile.getDateOfBirth().getYear()); assertEquals(1, profile.getDateOfBirth().getMonth()); assertEquals(1, profile.getDateOfBirth().getDay()); assertEquals(3, profile.getEducations().size()); assertEquals("MSc Innovation & Technology Management", profile.getEducations().get(0).getDegree()); assertEquals("University College Dublin", profile.getEducations().get(0).getSchoolName()); assertEquals(2009, profile.getEducations().get(0).getEndDate().getYear()); assertEquals(2007, profile.getEducations().get(0).getStartDate().getYear()); assertEquals("None", profile.getHonors()); assertEquals(1, profile.getImAccounts().size()); assertEquals("robbiedrysdale", profile.getImAccounts().get(0).getImAccountName()); assertEquals("skype", profile.getImAccounts().get(0).getImAccountType()); assertEquals("Telecommunications", profile.getIndustry()); assertEquals("ie", profile.getLocation().getCountry()); assertEquals("Ireland", profile.getLocation().getName()); assertEquals(189, profile.getNumConnections()); assertEquals("Dublin, Ireland", profile.getMainAddress()); assertEquals(1, profile.getMemberUrlResources().size()); assertEquals("Company Website", profile.getMemberUrlResources().get(0).getName()); assertEquals("https: assertEquals(2, profile.getNumRecommenders()); assertEquals("+353 87 9580000", profile.getPhoneNumbers().get(0).getPhoneNumber()); assertEquals("mobile", profile.getPhoneNumbers().get(0).getPhoneType()); assertEquals(8, profile.getPositions().size()); assertEquals("133861560", profile.getPositions().get(0).getId()); assertEquals(true, profile.getPositions().get(0).getIsCurrent()); assertEquals(2010, profile.getPositions().get(0).getStartDate().getYear()); assertEquals(6, profile.getPositions().get(0).getStartDate().getMonth()); assertEquals(0, profile.getPositions().get(0).getStartDate().getDay()); assertEquals("CBW at robatron, a Media Streaming startup. Ongoing Technology research into potential new products.", profile.getPositions().get(0).getSummary()); assertEquals("CBW", profile.getPositions().get(0).getTitle()); assertEquals("Computer Software", profile.getPositions().get(0).getCompany().getIndustry()); assertEquals("robatron", profile.getPositions().get(0).getCompany().getName()); assertEquals(2, profile.getRecommendationsReceived().size()); assertEquals("Great guy to work with, open, friendly and approachable as well as very knowledgeable on a wide range of areas outside the immediate remit of standard java development. In all an asset to any team, would be happy to work with him again.", profile.getRecommendationsReceived().get(0).getRecommendationText()); assertEquals(RecommendationType.COLLEAGUE, profile.getRecommendationsReceived().get(0).getRecommendationType()); assertEquals("Damien", profile.getRecommendationsReceived().get(0).getRecommender().getFirstName()); assertEquals(3, profile.getSkills().size()); assertEquals("Java", profile.getSkills().get(0)); assertEquals(206,profile.getSpecialties().length()); assertEquals(462,profile.getSummary().length()); assertEquals("robdrysdale",profile.getTwitterAccounts().get(0).getProviderAccountName()); }