Package com.jcabi.github

Examples of com.jcabi.github.Repo


     * It should create an issue first, and then pull with the same number
     * @throws Exception if some problem inside
     */
    @Test
    public void canCreateAPull() throws Exception {
        final Repo repo = MkPullsTest.repo();
        final Pull pull = repo.pulls().create("hello", "", "");
        final Issue.Smart issue = new Issue.Smart(
            repo.issues().get(pull.number())
        );
        MatcherAssert.assertThat(
            issue.title(),
            Matchers.is("hello")
        );
View Full Code Here


     * @throws Exception if a problem occurs
     */
    @Test
    public void canSearchForIssues() throws Exception {
        final MkGithub github = new MkGithub();
        final Repo repo = github.repos().create(
            Json.createObjectBuilder().add("name", "TestIssues").build()
        );
        repo.issues().create("test issue", "TheTest");
        MatcherAssert.assertThat(
            github.search().issues(
                "TheTest",
                "updated",
                Search.Order.DESC,
View Full Code Here

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

     * @throws Exception - if anything goes wrong.
     */
    @Test
    public void returnsMkMilestones() throws Exception {
        final Repos repos = new MkRepos(new MkStorage.InFile(), "jeff");
        final Repo repo = repos.create(
            Json.createObjectBuilder().add("name", "test1").build()
        );
        final Milestones milestones = repo.milestones();
        MatcherAssert.assertThat(milestones, Matchers.notNullValue());
    }
View Full Code Here

     * @throws IOException if some problem inside
     */
    @Test
    public void fetchCommits() throws IOException {
        final String user = "testuser";
        final Repo repo = new MkRepo(
            new MkStorage.InFile(),
            user,
            new Coordinates.Simple(user, "testrepo")
        );
        MatcherAssert.assertThat(repo.commits(), Matchers.notNullValue());
    }
View Full Code Here

     * Repo can exponse attributes.
     * @throws Exception If some problem inside
     */
    @Test
    public void exposesAttributes() throws Exception {
        final Repo repo = new MkGithub().randomRepo();
        MatcherAssert.assertThat(
            new Repo.Smart(repo).description(),
            Matchers.notNullValue()
        );
        MatcherAssert.assertThat(
View Full Code Here

     * @throws IOException if some problem inside
     */
    @Test
    public void fetchStars() throws IOException {
        final String user = "testuser2";
        final Repo repo = new MkRepo(
            new MkStorage.InFile(),
            user,
            new Coordinates.Simple(user, "testrepo2")
        );
        MatcherAssert.assertThat(repo.stars(), Matchers.notNullValue());
    }
View Full Code Here

     * @throws IOException if some problem inside
     */
    @Test
    public void fetchNotifications() throws IOException {
        final String user = "testuser3";
        final Repo repo = new MkRepo(
            new MkStorage.InFile(),
            user,
            new Coordinates.Simple(user, "testrepo3")
        );
        MatcherAssert.assertThat(repo.notifications(), Matchers.notNullValue());
    }
View Full Code Here

     *
     * @throws Exception if some problem inside
     */
    @Test
    public void canRemoveFile() throws Exception {
        final Repo repo = MkContentsTest.repo();
        final String path = "removeme.txt";
        this.createFile(repo, path);
        final JsonObject json = MkContentsTest
            .content(path, "theDeleteMessage")
            .add("committer", MkContentsTest.committer())
            .build();
        final RepoCommit commit = repo.contents().remove(json);
        MatcherAssert.assertThat(commit, Matchers.notNullValue());
        MatcherAssert.assertThat(
            commit.json().getString("message"),
            Matchers.equalTo("theDeleteMessage")
        );
View Full Code Here

     * @throws Exception if some problem inside
     */
    @Test
    public void canRemoveFileFromBranch() throws Exception {
        final String branch = "branch-1";
        final Repo repo = MkContentsTest.repo();
        final String path = "removeme.txt";
        this.createFile(repo, path);
        final JsonObject json = MkContentsTest
            .content(path, "theDeleteMessage")
            .add("ref", branch)
            .add("committer", MkContentsTest.committer())
            .build();
        final RepoCommit commit = repo.contents().remove(json);
        MatcherAssert.assertThat(commit, Matchers.notNullValue());
        MatcherAssert.assertThat(
            commit.json().getString("message"),
            Matchers.equalTo("theDeleteMessage")
        );
View Full Code Here

TOP

Related Classes of com.jcabi.github.Repo

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.