GistTemplate extends AbstractGitHubOperations implements GistOperations { public List<GitHubComment> getGistComments(String id) { return asList(restTemplate.getForObject(buildUri("gists/{id}/comments"), GitHubComment[].class, id)); } GistTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); List<GitHubGist> getUserGists(String user); List<GitHubGist> getGists(); List<GitHubGist> getPublicGists(); List<GitHubGist> getStarredGists(); GitHubGist getGist(String id); List<GitHubComment> getGistComments(String id); GitHubComment getGistComment(Long id);  }
@Test public void getGistComments() { responseHeaders.setContentType(MediaType.APPLICATION_JSON); mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("gist-comments"), MediaType.APPLICATION_JSON)); List<GitHubComment> comments = gitHub.gistOperations().getGistComments("1651139"); assertEquals(2, comments.size()); verifyComment(comments.get(0)); }