Package com.jcabi.github

Examples of com.jcabi.github.Pull$Smart


     * @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 when a problem occurs.
     */
    @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

     * @throws Exception when a problem occurs.
     */
    @Test
    public void canGetCommentsNumberIfNonZero() throws Exception {
        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

     * @throws Exception when a problem occurs.
     */
    @Test
    public void canGetComments() throws Exception {
        final Repo repo =  MkPullTest.repo();
        final Pull pull = repo.pulls().create("", "", "");
        MatcherAssert.assertThat(
            pull.comments(),
            Matchers.notNullValue()
        );
    }
View Full Code Here

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

     *
     * @throws Exception If a problem occurs.
     */
    @Test
    public void canPatchJson() throws Exception {
        final Pull pull = repo().pulls().create("Test Patch", "def", "abc");
        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

TOP

Related Classes of com.jcabi.github.Pull$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.