UserTemplate extends AbstractGitHubOperations implements UserOperations { public GitHubUserProfile getUserProfile() { return restTemplate.getForObject(buildUri("user"), GitHubUserProfile.class); } UserTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); List<GitHubUser> getFollowers(String user); List<GitHubUser> getFollowing(String user); String getProfileId(); GitHubUserProfile getUserProfile(); String getProfileUrl();  }
@Test public void getUserProfile() throws Exception { mockServer.expect(requestTo("https: .andExpect(header("Authorization", "Bearer ACCESS_TOKEN")) .andRespond(withSuccess(new ClassPathResource("profile.json", getClass()), MediaType.APPLICATION_JSON)); GitHubUserProfile profile = gitHub.userOperations().getUserProfile(); assertEquals("habuma", profile.getLogin()); assertEquals("Craig Walls", profile.getName()); assertEquals("SpringSource", profile.getCompany()); assertEquals("https: assertEquals("cwalls at vmware.com", profile.getEmail()); assertEquals(167926, profile.getId()); }