Package com.jcabi.http.request

Examples of com.jcabi.http.request.ApacheRequest


                HttpURLConnection.HTTP_OK,
                "{\"sha\":\"abdes00test\",\"tag\":\"v.0.1\"}"
            )
        ).start();
        final Tag tag = new RtTag(
            new ApacheRequest(container.home()), repo(), "abdes00test"
        );
        try {
            MatcherAssert.assertThat(
                tag.json().getString("tag"),
                Matchers.is("v.0.1")
View Full Code Here


        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "response")
        ).start();
        final RtOrganization org = new RtOrganization(
            new MkGithub(),
            new ApacheRequest(container.home()),
            "testPatch"
        );
        org.patch(
            Json.createObjectBuilder().add("patch", "test").build()
        );
View Full Code Here

        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "blah")
        ).start();
        final RtOrganization org = new RtOrganization(
            new MkGithub(),
            new ApacheRequest(container.home()),
            "testToString"
        );
        try {
            MatcherAssert.assertThat(
                org.toString(),
View Full Code Here

                HttpURLConnection.HTTP_NO_CONTENT,
                ""
            )
        ).start();
        final DeployKey key = new RtDeployKey(
            new ApacheRequest(container.home()),
            3,
            RtDeployKeyTest.repo()
        );
        key.remove();
        final MkQuery query = container.take();
View Full Code Here

            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, body)
        ).start();
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
        final RtPullComment comment =
            new RtPullComment(new ApacheRequest(container.home()), pull, 1);
        try {
            final JsonObject json = comment.json();
            MatcherAssert.assertThat(
                json.getString("body"),
                Matchers.is("test")
View Full Code Here

            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final Pull pull = Mockito.mock(Pull.class);
        Mockito.doReturn(repo()).when(pull).repo();
        final RtPullComment comment =
            new RtPullComment(new ApacheRequest(container.home()), pull, 2);
        try {
            final JsonObject json = Json.createObjectBuilder()
                .add("body", "test comment").build();
            comment.patch(json);
            final MkQuery query = container.take();
View Full Code Here

                HttpURLConnection.HTTP_CREATED,
                "{\"sha\":\"0abcd89jcabitest\",\"url\":\"http://localhost/1\"}"
            )
        ).start();
        final Trees trees = new RtTrees(
            new ApacheRequest(container.home()),
            repo()
        );
        final JsonObject tree = Json.createObjectBuilder()
            .add("path", "/path").add("mode", "100644 ")
            .add("type", "blob").add("sha", "sha1")
View Full Code Here

        );
        container.start();
        try {
            MatcherAssert.assertThat(
                new RtDeployKeys(
                    new ApacheRequest(container.home()),
                    RtDeployKeysTest.repo()
                ).iterate(),
                Matchers.<DeployKey>iterableWithSize(2)
            );
        } finally {
View Full Code Here

            )
        );
        container.start();
        try {
            final DeployKeys keys = new RtDeployKeys(
                new ApacheRequest(container.home()), RtDeployKeysTest.repo()
            );
            MatcherAssert.assertThat(
                keys.create("Title", "Key").number(),
                Matchers.equalTo(number)
            );
View Full Code Here

                HttpURLConnection.HTTP_OK,
                "{\"ref\":\"refs/heads/featureA\"}"
            )
        ).start();
        final Reference reference = new RtReference(
            new ApacheRequest(container.home()), repo(), "refs/heads/featureA"
        );
        try {
            reference.patch(
                Json.createObjectBuilder().add("sha", "abcdef12345")
                .add("force", "false").build()
View Full Code Here

TOP

Related Classes of com.jcabi.http.request.ApacheRequest

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.