Examples of GitHubRepo


Examples of org.springframework.social.github.api.GitHubRepo

    Application app = applicationRepository.findOne(id);
    GitHubScm scm = app.getScm();
   
    // Supporting data comes from GitHub
    // FIXME This web service call shouldn't be part of the transaction
    GitHubRepo repo = gitHub().repoOperations().getRepo(scm.getUser(), scm.getRepo());
    scm.setId(repo.getId());
    scm.setName(repo.getName());
    scm.setDescription(repo.getDescription());
    scm.setUrl(repo.getUrl());
    scm.setHtmlUrl(repo.getHtmlUrl());
    scm.setGitUrl(repo.getGitUrl());
    scm.setSshUrl(repo.getSshUrl());
    scm.setSvnUrl(repo.getSvnUrl());
   
    return app;
  }
View Full Code Here

Examples of org.springframework.social.github.api.GitHubRepo

    @Test
    public void getRepoInfo_fetchesGitHubRepos() {
        given(ghClient.sendRequestForJson(anyString(), anyVararg())).willReturn(Fixtures.githubRepoJson());

        GitHubRepo repoInfo = service.getRepoInfo("repo");
        assertThat(repoInfo.getName(), equalTo("spring-boot"));
    }
View Full Code Here

Examples of org.springframework.social.github.api.GitHubRepo

    @Before
    public void setup() throws IOException {
        initMocks(this);
        given(org.getName()).willReturn("mock-org");
        tutorials = new Tutorials(org, null);
        repo = new GitHubRepo();
        repo.setName("tut-rest");
        repo.setDescription("Rest tutorial :: Learn some rest stuff");
        readme = new Readme();
        readme.setName("README.adoc");
        tutorial = new AsciidocGuide("REST Tutorial", new HashSet<>(), new HashSet<>(), "Table of C", new HashMap<>());
View Full Code Here

Examples of org.springframework.social.github.api.GitHubRepo

    @Test
    public void loadImage() throws IOException {
        byte[] bytes = new byte[] { 'a' };
        String imageName = "welcome.png";

        GitHubRepo dummyRepo = new GitHubRepo();
        dummyRepo.setDescription("dummy");
        given(org.getRepoInfo(anyString())).willReturn(dummyRepo);

        given(org.getGuideImage(eq(GUIDE_REPO_NAME), eq(imageName))).willReturn(bytes);

        byte[] result = gsGuides.loadImage(gsRestService, imageName);
View Full Code Here

Examples of org.springframework.social.github.api.GitHubRepo

    @SuppressWarnings("unchecked")
    @Test(expected = ResourceNotFoundException.class)
    public void unknownImage() {
        String unknownImage = "uknown_image.png";

        GitHubRepo dummyRepo = new GitHubRepo();
        dummyRepo.setDescription("dummy");
        given(org.getRepoInfo(anyString())).willReturn(dummyRepo);

        given(org.getGuideImage(eq(GUIDE_REPO_NAME), eq(unknownImage))).willThrow(RestClientException.class);

        gsGuides.loadImage(gsRestService, unknownImage);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.