Package com.jcabi.github

Examples of com.jcabi.github.PullComments


     *
     * @throws Exception If something goes wrong.
     */
    @Test
    public void fetchesPullComment() throws Exception {
        final PullComments comments = this.comments();
        final PullComment comment = comments.post("comment", "commit", "/", 1);
        MatcherAssert.assertThat(
            comments.get(comment.number()).number(),
            Matchers.equalTo(comment.number())
        );
    }
View Full Code Here


     *
     * @throws Exception If something goes wrong.
     */
    @Test
    public void iteratesRepoPullComments() throws Exception {
        final PullComments comments = comments();
        comments.pull()
            .repo()
            .pulls()
            .create("new", "", "")
            .comments()
            .post("new pull comment", "new commit", "/p", 1);
        comments.post("test 1", "tesst 1", "/test1", 1);
        MatcherAssert.assertThat(
            comments.iterate(
                comments.pull().number(),
                Collections.<String, String>emptyMap()
            ),
            Matchers.<PullComment>iterableWithSize(1)
        );
        MatcherAssert.assertThat(
            comments.iterate(
                Collections.<String, String>emptyMap()
            ),
            Matchers.<PullComment>iterableWithSize(2)
        );
    }
View Full Code Here

     *
     * @throws Exception If something goes wrong.
     */
    @Test
    public void iteratesPullRequestComments() throws Exception {
        final PullComments comments = comments();
        comments.post("comment 1", "commit 1", "/commit1", 1);
        comments.post("comment 2", "commit 2", "/commit2", 2);
        MatcherAssert.assertThat(
            comments.iterate(
                comments.pull().number(),
                Collections.<String, String>emptyMap()
            ),
            Matchers.<PullComment>iterableWithSize(2)
        );
    }
View Full Code Here

     *
     * @throws Exception If something goes wrong.
     */
    @Test
    public void createsPullCommentReply() throws Exception {
        final PullComments comments = this.comments();
        final int orig = comments.post(
            "Orig Comment",
            "6dcb09b5b57875f334f61aebed695e2e4193db5e",
            "file1.txt",
            1
        ).number();
        final String body = "Reply Comment";
        final JsonObject reply = comments.reply(body, orig).json();
        MatcherAssert.assertThat(
            reply.getString("body"),
            Matchers.is(body)
        );
        MatcherAssert.assertThat(
View Full Code Here

     *
     * @throws Exception If something goes wrong.
     */
    @Test
    public void removesPullComment() throws Exception {
        final PullComments comments = this.comments();
        final int orig = comments.post(
            "Origg Comment",
            "6dcb09b5b57875f334f61aebed695e2e4193db5d",
            "file2.txt",
            1
        ).number();
        MatcherAssert.assertThat(
            comments.iterate(
                orig, Collections.<String, String>emptyMap()
            ),
            Matchers.<PullComment>iterableWithSize(1)
        );
        comments.remove(orig);
        MatcherAssert.assertThat(
            comments.iterate(
                orig, Collections.<String, String>emptyMap()
            ),
            Matchers.<PullComment>iterableWithSize(0)
        );
    }
View Full Code Here

TOP

Related Classes of com.jcabi.github.PullComments

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.