src/test/java/com/jcabi/github/RtCommitsComparisonTest.java
/**
     * RtCommitsComparison can fetch JSON.
     * @throws Exception If some problem inside
     * @checkstyle MultipleStringLiterals (25 lines)
     */
RtCommitsComparison can fetch JSON.
@throws Exception If some problem inside
@checkstyle MultipleStringLiterals (25 lines)
RtCommitsComparison can fetch JSON . @throws Exception If some problem inside @checkstyle MultipleStringLiterals ( 25 lines )
@Test
    public void fetchesJson() throws Exception {
        final CommitsComparison comparison = new RtCommitsComparison(
            new FakeRequest().withBody(
                Json.createObjectBuilder()
                    .add("base_commit", Json.createObjectBuilder())
                    .add("commits", Json.createArrayBuilder())
                    .add("files", Json.createArrayBuilder())
                    .build().toString()
            ),
            RtCommitsComparisonTest.repo(),
            "6dcb09b5b57875f334f61aebed695e2e4193db51",
            "6dcb09b5b57875f334f61aebed695e2e4193db52"
        );
        final JsonObject json = comparison.json();
        MatcherAssert.assertThat(
            json.getJsonObject("base_commit"), Matchers.notNullValue()
        );
        MatcherAssert.assertThat(
            json.getJsonArray("commits"), Matchers.notNullValue()
        );
        MatcherAssert.assertThat(
            json.getJsonArray("files"), Matchers.notNullValue()
        );
    }
@ Test public void fetchesJson ( ) throws Exception { final CommitsComparison comparison = new RtCommitsComparison ( new FakeRequest ( ) . withBody ( Json . createObjectBuilder ( ) . add ( "base_commit" , Json . createObjectBuilder ( ) ) . add ( "commits" , Json . createArrayBuilder ( ) ) . add ( "files" , Json . createArrayBuilder ( ) ) . build ( ) . toString ( ) ) , RtCommitsComparisonTest . repo ( ) , "6dcb09b5b57875f334f61aebed695e2e4193db51" , "6dcb09b5b57875f334f61aebed695e2e4193db52" ) ; final JsonObject json = comparison . json ( ) ; MatcherAssert . assertThat ( json . getJsonObject ( "base_commit" ) , Matchers . notNullValue ( ) ) ; MatcherAssert . assertThat ( json . getJsonArray ( "commits" ) , Matchers . notNullValue ( ) ) ; MatcherAssert . assertThat ( json . getJsonArray ( "files" ) , Matchers . notNullValue ( ) ) ; }
RtCommitsComparison can fetch JSON.
RtCommitsComparison can fetch JSON .