Examples of Repo


Examples of com.jcabi.github.Repo

     * MkGithub can work.
     * @throws Exception If some problem inside
     */
    @Test
    public void worksWithMockedData() throws Exception {
        final Repo repo = new MkGithub().repos().create(MkGithubTest.json());
        final Issue issue = repo.issues().create("hey", "how are you?");
        final Comment comment = issue.comments().post("hey, works?");
        MatcherAssert.assertThat(
            new Comment.Smart(comment).body(),
            Matchers.startsWith("hey, ")
        );
        MatcherAssert.assertThat(
            repo.issues().get(issue.number()).comments().iterate(),
            Matchers.<Comment>iterableWithSize(1)
        );
        MatcherAssert.assertThat(
            new User.Smart(new Comment.Smart(comment).author()).login(),
            Matchers.equalTo(
                new User.Smart(repo.github().users().self()).login()
            )
        );
    }
View Full Code Here

Examples of com.jcabi.github.Repo

     */
    @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

Examples of com.jcabi.github.Repo

     * @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

Examples of com.jcabi.github.Repo

     * 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

Examples of com.jcabi.github.Repo

                    .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

Examples of com.jcabi.github.Repo

     *
     * @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

Examples of com.jcabi.github.Repo

     */
    @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

Examples of com.jcabi.github.Repo

     * @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

Examples of com.jcabi.github.Repo

     * @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

Examples of com.jcabi.github.Repo

     * @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
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.