Examples of ApacheRequest


Examples of com.jcabi.http.request.ApacheRequest

    public void sendHttpRequestAndWriteResponseAsJson() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "{\"msg\": \"hi\"}")
        ).start();
        final RtLabel label = new RtLabel(
            new ApacheRequest(container.home()),
            RtLabelTest.repo(),
            "bug"
        );
        MatcherAssert.assertThat(
            label.json().getString("msg"),
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

    public void executePatchRequest() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "{\"msg\":\"hi\"}")
        ).start();
        final RtLabel label = new RtLabel(
            new ApacheRequest(container.home()),
            RtLabelTest.repo(),
            "enhance"
        );
        label.patch(
            Json.createObjectBuilder()
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

        final String body = blob().toString();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, body)
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, body)).start();
        final RtBlobs blobs = new RtBlobs(
            new ApacheRequest(container.home()),
            repo()
        );
        try {
            final Blob blob = blobs.create(content, "utf-8");
            MatcherAssert.assertThat(
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

                .start();
        final MkContainer gistContainer = new MkGrizzlyContainer().start();
        final RtGist gist =
            new RtGist(
                new MkGithub(),
                new ApacheRequest(gistContainer.home()), "someName"
            );
        final RtGistComment comment = new RtGistComment(
            new ApacheRequest(container.home()), gist, identifier
        );
        comment.patch(Json.createObjectBuilder()
            .add(bodyString, patchedBody)
            .add(idString, identifier)
            .build()
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

            new MkGithub(),
            new FakeRequest().withStatus(HttpURLConnection.HTTP_NO_CONTENT),
            "gistName"
        );
        final RtGistComment comment = new RtGistComment(
            new ApacheRequest(container.home()), gist, identifier
        );
        comment.remove();
        MatcherAssert.assertThat(
            container.take().method(),
            Matchers.equalTo(Request.DELETE)
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

                    .add(key(2))
                    .build().toString()
            )
        ).start();
        final RtPublicKeys keys = new RtPublicKeys(
            new ApacheRequest(container.home()),
            Mockito.mock(User.class)
        );
        MatcherAssert.assertThat(
            keys.iterate(),
            Matchers.<PublicKey>iterableWithSize(2)
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

                HttpURLConnection.HTTP_OK,
                ""
            )
        ).start();
        final RtPublicKeys keys = new RtPublicKeys(
            new ApacheRequest(container.home()),
            Mockito.mock(User.class)
        );
        try {
            MatcherAssert.assertThat(
                keys.get(1),
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

                HttpURLConnection.HTTP_NO_CONTENT,
                ""
            )
        ).start();
        final RtPublicKeys keys = new RtPublicKeys(
            new ApacheRequest(container.home()),
            Mockito.mock(User.class)
        );
        try {
            keys.remove(1);
            final MkQuery query = container.take();
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

                HttpURLConnection.HTTP_CREATED, key(1).toString()
            )
        ).start();
        try {
            final RtPublicKeys keys = new RtPublicKeys(
                new ApacheRequest(container.home()),
                Mockito.mock(User.class)
            );
            MatcherAssert.assertThat(
                keys.create("theTitle", "theKey").number(),
                Matchers.is(1)
View Full Code Here

Examples of com.jcabi.http.request.ApacheRequest

                "{\"login\":\"octocate\"}"
            )
        ).start();
        final RtUser json = new RtUser(
            Mockito.mock(Github.class),
            new ApacheRequest(container.home())
        );
        json.patch(
            Json.createObjectBuilder()
                .add("location", "San Francisco")
                .build()
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.