Examples of json()


Examples of com.jcabi.github.PublicKey.json()

        final String patched = String.format("%s_patch", original);
        key.patch(
            Json.createObjectBuilder().add(KEY, patched).build()
        );
        MatcherAssert.assertThat(
            key.json().getString(KEY),
            Matchers.equalTo(patched)
        );
    }

}
View Full Code Here

Examples of com.jcabi.github.Pull.json()

     */
    @Test
    public void canGetCommentsNumberIfZero() throws Exception {
        final Pull pull = MkPullTest.repo().pulls().create("", "", "");
        MatcherAssert.assertThat(
            pull.json().getInt("comments"),
            Matchers.is(0)
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.Pull.json()

        final Repo repo =  MkPullTest.repo();
        final Pull pull = repo.pulls().create("", "", "");
        pull.comments().post("comment1", "path1", "how are you?", 1);
        pull.comments().post("comment2", "path2", "how are you2?", 2);
        MatcherAssert.assertThat(
            pull.json().getInt("comments"),
            Matchers.is(2)
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.Pull.json()

    @Test
    public void canRetrieveAsJson() throws Exception {
        final String head = "blah";
        final String base = "aaa";
        final Pull pull = repo().pulls().create("Test Pull Json", head, base);
        final JsonObject json = pull.json();
        MatcherAssert.assertThat(
            json.getString("number"),
            Matchers.equalTo("1")
        );
        MatcherAssert.assertThat(
View Full Code Here

Examples of com.jcabi.github.Pull.json()

        final String value = "someValue";
        pull.patch(
            Json.createObjectBuilder().add("patch", value).build()
        );
        MatcherAssert.assertThat(
            pull.json().getString("patch"),
            Matchers.equalTo(value)
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.PullComment.json()

     */
    @Test
    public void retrieveAsJson() throws Exception {
        final PullComment comment = MkPullCommentTest.comment();
        MatcherAssert.assertThat(
            comment.json().getString("url"),
            Matchers.startsWith("http://")
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.PullComment.json()

    public void executePatchRequest() throws Exception {
        final String path = "/path/to/file.txt";
        final PullComment comment = MkPullCommentTest.comment();
        comment.patch(Json.createObjectBuilder().add("path", path).build());
        MatcherAssert.assertThat(
            comment.json().toString(),
            Matchers.containsString(path)
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.Reference.json()

     * @throws Exception - If something goes wrong.
     */
    @Test
    public void fetchesJson() throws Exception {
        final Reference ref = this.reference();
        final JsonObject json = ref.json();
        MatcherAssert.assertThat(
            json.getString("ref"),
            Matchers.is("refs/tags/hello")
        );
        MatcherAssert.assertThat(
View Full Code Here

Examples of com.jcabi.github.Reference.json()

        final JsonObject json = Json.createObjectBuilder()
            .add("sha", "testshaPATCH")
            .build();
        ref.patch(json);
        MatcherAssert.assertThat(
            ref.json().getString("sha"),
            Matchers.is("testshaPATCH")
        );
    }

    /**
 
View Full Code Here

Examples of com.jcabi.github.Release.json()

    public void canCreateRelease() throws Exception {
        final Releases releases = MkReleasesTest.repo().releases();
        final String tag = "v1.0.0";
        final Release release = releases.create(tag);
        MatcherAssert.assertThat(
            release.json().getString("tag_name"),
            Matchers.equalTo(tag)
        );
    }

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