RepoTemplate extends AbstractGitHubOperations implements RepoOperations { public List<GitHubDownload> getDownloads(String user, String repo) { return asList(restTemplate.getForObject(buildRepoUri("/downloads"), GitHubDownload[].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 getDownloads() { responseHeaders.setContentType(MediaType.APPLICATION_JSON); mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("repo-downloads"), MediaType.APPLICATION_JSON)); assertEquals(4, gitHub.repoOperations().getDownloads("williewheeler", "skybase").size()); }