Package com.jcabi.http.mock

Examples of com.jcabi.http.mock.MkContainer.take()


                Json.createObjectBuilder()
                    .add("content", "hi you!")
                    .build()
            );
            MatcherAssert.assertThat(
                container.take().method(),
                Matchers.equalTo(Request.PATCH)
            );
        } finally {
            container.stop();
        }
View Full Code Here


        try {
            final PullComment pullComment = pullComments.post(
                body, commit, path, position
            );
            MatcherAssert.assertThat(
                container.take().method(),
                Matchers.equalTo(Request.POST)
            );
            MatcherAssert.assertThat(
                new PullComment.Smart(pullComment).commitId(),
                Matchers.equalTo(commit)
View Full Code Here

        try {
            final PullComment pullComment = pullComments.reply(
                body, number
            );
            MatcherAssert.assertThat(
                container.take().method(),
                Matchers.equalTo(Request.POST)
            );
            MatcherAssert.assertThat(
                new PullComment.Smart(pullComment).reply(),
                Matchers.equalTo(number)
View Full Code Here

        Mockito.doReturn(repo()).when(pull).repo();
        final RtPullComments comments =
            new RtPullComments(new ApacheRequest(container.home()), pull);
        try {
            comments.remove(2);
            final MkQuery query = container.take();
            MatcherAssert.assertThat(
                query.method(), Matchers.equalTo(Request.DELETE)
            );
            MatcherAssert.assertThat(
                query.uri().toString(),
View Full Code Here

            "path"
        );
        content.patch(
            Json.createObjectBuilder().add("patch", "test").build()
        );
        final MkQuery query = container.take();
        try {
            MatcherAssert.assertThat(
                query.method(),
                Matchers.equalTo(Request.PATCH)
            );
View Full Code Here

            MatcherAssert.assertThat(
                IOUtils.toString(stream, Charsets.UTF_8),
                Matchers.is(raw)
            );
            MatcherAssert.assertThat(
                container.take().headers().get(HttpHeaders.ACCEPT).get(0),
                Matchers.is("application/vnd.github.v3.raw")
            );
        } finally {
            stream.close();
            container.stop();
View Full Code Here

                    Json.createObjectBuilder().add("hello", "world").build()
                ),
                Matchers.equalTo("{\"a\":\"b\"}")
            );
            MatcherAssert.assertThat(
                container.take().body(),
                Matchers.equalTo("{\"hello\":\"world\"}")
            );
        } finally {
            container.stop();
        }
View Full Code Here

            MatcherAssert.assertThat(
                markdown.raw("Hello World!"),
                Matchers.equalTo("Test Output")
            );
            MatcherAssert.assertThat(
                container.take().body(),
                Matchers.equalTo("Hello World!")
            );
        } finally {
            container.stop();
        }
View Full Code Here

            new ApacheRequest(container.home()),
            repo()
        );
        milestones.remove(1);
        MatcherAssert.assertThat(
            container.take().method(),
            Matchers.equalTo(Request.DELETE)
        );
    }

    /**
 
View Full Code Here

            new JdkRequest(container.home()),
            repo()
        );
        final Label label = labels.create(name, color);
        MatcherAssert.assertThat(
            container.take().method(),
            Matchers.equalTo(Request.POST)
        );
        MatcherAssert.assertThat(
            new Label.Smart(label).name(),
            Matchers.equalTo(name)
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.