RepoTemplate extends AbstractGitHubOperations implements RepoOperations { public List<GitHubIssue> getIssues(String user, String repo) { return asList(restTemplate.getForObject(buildRepoUri("/issues"), GitHubIssue[].class, user, repo)); } RepoTemplate(RestTemplate restTemplate, boolean isAuthorizedForUser); GitHubRepo getRepo(String user, String repo); List<GitHubUser> getCollaborators(String user, String repo); List<GitHubCommit> getCommits(String user, String repo); List<GitHubDownload> getDownloads(String user, String repo); GitHubDownload getDownload(String user, String repo, Long id); List<GitHubRepo> getForks(String user, String repo); List<GitHubIssue> getIssues(String user, String repo); List<GitHubUser> getWatchers(String user, String repo); List<GitHubHook> getHooks(String user, String repo);  }
@Test public void getIssues() { responseHeaders.setContentType(MediaType.APPLICATION_JSON); mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("repo-issues"), MediaType.APPLICATION_JSON)); List<GitHubIssue> issues = gitHub.repoOperations().getIssues("spring-guides", "gs-rest-service"); assertEquals(1, issues.size()); GitHubIssue issue = issues.get(0); assertEquals(10, issue.getNumber()); assertEquals("open", issue.getState()); assertEquals("Use WAR packaging for rest service", issue.getTitle()); assertEquals("You can deploy to WTP, build a war, execute it (java -jar) or use mvn exec.", issues.get(0).getBody()); assertEquals("https: issues.get(0).getUrl()); assertEquals("https: issues.get(0).getHtmlUrl()); assertEquals(new Date(1370334590000L), issue.getCreatedAt()); assertEquals(new Date(1370939025000L), issue.getUpdatedAt()); assertNull(issue.getClosedAt()); }