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)
        );
        container.stop();
    }
View Full Code Here


            repo()
        );
        try {
            final Blob blob = blobs.create(content, "utf-8");
            MatcherAssert.assertThat(
                container.take().method(),
                Matchers.equalTo(Request.POST)
            );
            MatcherAssert.assertThat(
                new Blob.Smart(blob).url(),
                Matchers.equalTo("http://localhost/1")
View Full Code Here

        final RtGistComment comment = new RtGistComment(
            new ApacheRequest(container.home()), gist, identifier
        );
        comment.remove();
        MatcherAssert.assertThat(
            container.take().method(),
            Matchers.equalTo(Request.DELETE)
        );
        container.stop();
    }
}
View Full Code Here

            "testWrite"
        );
        gist.write("testFile", "testContent");
        try {
            MatcherAssert.assertThat(
                container.take().body(),
                Matchers.containsString(
                    "\"testFile\":{\"content\":\"testContent\"}"
                )
            );
        } finally {
View Full Code Here

            MatcherAssert.assertThat(
                smart.files(),
                Matchers.notNullValue()
            );
            MatcherAssert.assertThat(
                container.take().uri().toString(),
                Matchers.endsWith("/gists/testGetFiles")
            );
        } finally {
            container.stop();
        }
View Full Code Here

            new ApacheRequest(container.home()),
            Mockito.mock(User.class)
        );
        try {
            keys.remove(1);
            final MkQuery query = container.take();
            MatcherAssert.assertThat(
                query.uri().toString(),
                Matchers.endsWith("/user/keys/1")
            );
            MatcherAssert.assertThat(
View Full Code Here

            );
            MatcherAssert.assertThat(
                keys.create("theTitle", "theKey").number(),
                Matchers.is(1)
            );
            final MkQuery query = container.take();
            MatcherAssert.assertThat(
                query.uri().toString(),
                Matchers.endsWith("/user/keys")
            );
            MatcherAssert.assertThat(
View Full Code Here

            Json.createObjectBuilder()
                .add("location", "San Francisco")
                .build()
        );
        MatcherAssert.assertThat(
            container.take().method(),
            Matchers.equalTo(Request.PATCH)
        );
        container.stop();
    }
View Full Code Here

            new JdkRequest(container.home()),
            repo()
        );
        final Issue issue = issues.create(title, "having a problem with it.");
        MatcherAssert.assertThat(
            container.take().method(),
            Matchers.equalTo(Request.POST)
        );
        MatcherAssert.assertThat(
            new Issue.Smart(issue).title(),
            Matchers.equalTo(title)
View Full Code Here

            new MkGithub(),
            new ApacheRequest(container.home()),
            "unstar"
        );
        gist.unstar();
        final MkQuery query = container.take();
        MatcherAssert.assertThat(
            query.method(),
            Matchers.equalTo(Request.DELETE)
        );
        MatcherAssert.assertThat(
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.