Package com.jcabi.github

Examples of com.jcabi.github.Repo$Smart


     */
    @Test
    public void canRelogin() throws Exception {
        final String login = "mark";
        final MkGithub github = new MkGithub();
        final Repo repo = github.repos().create(MkGithubTest.json());
        final Issue issue = repo.issues().create("title", "Found a bug");
        final Comment comment = github
            .relogin(login)
            .repos()
            .get(repo.coordinates())
            .issues()
            .get(issue.number())
            .comments()
            .post("Nice change");
        MatcherAssert.assertThat(
            new User.Smart(new Comment.Smart(comment).author()).login(),
            Matchers.not(
                Matchers.equalTo(
                    new User.Smart(repo.github().users().self()).login()
                )
            )
        );
        MatcherAssert.assertThat(
            new User.Smart(new Comment.Smart(comment).author()).login(),
View Full Code Here


     * @throws Exception if some problem inside
     */
    @Test
    public void canCreateRandomRepo() throws Exception {
        final MkGithub github = new MkGithub();
        final Repo repo = github.randomRepo();
        MatcherAssert.assertThat(
            github.repos().get(repo.coordinates()).coordinates(),
            Matchers.equalTo(repo.coordinates())
        );
    }
View Full Code Here

     * MkForks can list forks.
     * @throws Exception If some problem inside
     */
    @Test
    public void iteratesForks() throws Exception {
        final Repo repo = this.repo();
        final Fork fork = repo.forks().create("Organization");
        final Iterable<Fork> iterate = repo.forks().iterate("Order");
        MatcherAssert.assertThat(
            iterate,
            Matchers.<Fork>iterableWithSize(1)
        );
        MatcherAssert.assertThat(
View Full Code Here

                    .add("type", "blob")
                    .add("content", "hello")
                    .build()
            ).build()
        ).build();
        final Repo repo = this.repo();
        repo.git().trees().create(json);
        MatcherAssert.assertThat(
            repo.git().trees().getRec(sha).json().getString("sha"),
            Matchers.containsString(sha)
        );
    }
View Full Code Here

     *
     * @throws Exception if something goes wrong.
     */
    @Test
    public void canFetchOwnRepo() throws Exception {
        final Repo repo = repo();
        MatcherAssert.assertThat(
            repo.git().repo(),
            Matchers.equalTo(repo)
        );
    }
View Full Code Here

     */
    @Test
    public void canRememberItsAuthor() throws Exception {
        final MkGithub first = new MkGithub("first");
        final Github second = first.relogin("second");
        final Repo repo = first.repos().create(
            Json.createObjectBuilder().add("name", "test").build()
        );
        final int number = second.repos()
            .get(repo.coordinates())
            .issues()
            .create("", "")
            .number();
        final Issue issue = first.repos()
            .get(repo.coordinates())
            .issues()
            .get(number);
        MatcherAssert.assertThat(
            new Issue.Smart(issue).author().login(),
            Matchers.is("second")
View Full Code Here

     * @throws Exception If some problem inside
     */
    @Test
    public void createsRepository() throws Exception {
        final Repos repos = new MkRepos(new MkStorage.InFile(), "jeff");
        final Repo repo = MkReposTest.repo(repos, "test", "test repo");
        MatcherAssert.assertThat(
            repo.coordinates(),
            Matchers.hasToString("jeff/test")
        );
    }
View Full Code Here

     * @throws Exception If some problem inside
     */
    @Test
    public void createsRepositoryWithDetails() throws Exception {
        final Repos repos = new MkRepos(new MkStorage.InFile(), "jeff");
        final Repo repo = MkReposTest.repo(repos, "hello", "my test repo");
        MatcherAssert.assertThat(
            new Repo.Smart(repo).description(),
            Matchers.startsWith("my test")
        );
    }
View Full Code Here

     * @throws Exception If some problem inside
     */
    @Test
    public void removesRepo() throws Exception {
        final Repos repos = new MkRepos(new MkStorage.InFile(), "jeff");
        final Repo repo = MkReposTest.repo(repos, "remove-me", "remove repo");
        MatcherAssert.assertThat(
            repos.get(repo.coordinates()),
            Matchers.notNullValue()
        );
        repos.remove(repo.coordinates());
        this.thrown.expect(IllegalArgumentException.class);
        this.thrown.expectMessage("repository jeff/remove-me doesn't exist");
        repos.get(repo.coordinates());
    }
View Full Code Here

     * @throws Exception If fails
     */
    @Test
    public void fetchesLabelsFromGithub() throws Exception {
        final Github github = new RtGithub();
        final Repo repo = github.repos().get(
            new Coordinates.Simple("jcabi/jcabi-github")
        );
        MatcherAssert.assertThat(
            repo.labels().iterate().iterator().hasNext(),
            Matchers.equalTo(true)
        );
    }
View Full Code Here

TOP

Related Classes of com.jcabi.github.Repo$Smart

Copyright © 2018 www.massapicom. 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.