RepoTemplate extends AbstractGitHubOperations implements RepoOperations { public GitHubDownload getDownload(String user, String repo, Long id) { String uri = buildUri("repos/{user}/{repo}/downloads/{id}"); return restTemplate.getForObject(uri, GitHubDownload.class, user, repo, id); } 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 getDownload() { responseHeaders.setContentType(MediaType.APPLICATION_JSON); mockServer.expect(requestTo("https: .andExpect(method(GET)) .andRespond(withSuccess(jsonResource("repo-download"), MediaType.APPLICATION_JSON)); GitHubDownload download = gitHub.repoOperations().getDownload("williewheeler", "skybase", 201817L); assertEquals("disconnected.png", download.getName()); assertEquals(15360L, download.getSize()); assertEquals("image/png", download.getContentType()); assertEquals(2, download.getDownloadCount()); assertEquals("https: assertEquals("https: }