Package com.jcabi.http.request

Examples of com.jcabi.http.request.ApacheRequest


    public void patchWithJson() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "response")
        ).start();
        final RtIssue issue = new RtIssue(
            new ApacheRequest(container.home()),
            this.repo(),
            1
        );
        issue.patch(
            Json.createObjectBuilder().add("patch", "test").build()
View Full Code Here


    public void jumpNextPage() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            RtPaginationTest.simple("Hi Jeff")
                .withHeader("Link", "</s?page=3&per_page=100>; rel=\"next\"")
        ).next(RtPaginationTest.simple("Hi Mark")).start();
        final Request request = new ApacheRequest(container.home());
        final RtPagination<JsonObject> page = new RtPagination<JsonObject>(
            request, new RtPagination.Mapping<JsonObject, JsonObject>() {
                @Override
                public JsonObject map(final JsonObject object) {
                    return object;
View Full Code Here

    @Test(expected = NoSuchElementException.class)
    public void throwsIfNoMoreElement() throws Exception {
        final MkContainer container = new MkGrizzlyContainer()
            .next(simple("Hi there")).start();
        try {
            final Request request = new ApacheRequest(container.home());
            final RtPagination<JsonObject> page = new RtPagination<JsonObject>(
                request, new RtPagination.Mapping<JsonObject, JsonObject>() {
                    @Override
                    public JsonObject map(final JsonObject object) {
                        return object;
View Full Code Here

                HttpURLConnection.HTTP_NO_CONTENT,
                ""
            )
        ).start();
        final Releases releases = new RtReleases(
            new ApacheRequest(container.home()),
            RtReleasesTest.repo()
        );
        try {
            releases.remove(1);
            final MkQuery query = container.take();
View Full Code Here

        final String body = pull(title).toString();
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_CREATED, body)
        ).next(new MkAnswer.Simple(HttpURLConnection.HTTP_OK, body)).start();
        final RtPulls pulls = new RtPulls(
            new ApacheRequest(container.home()),
            repo()
        );
        final Pull pull = pulls.create(title, "octocat", "master");
        MatcherAssert.assertThat(
            container.take().method(),
View Full Code Here

                HttpURLConnection.HTTP_OK,
                pull(title).toString()
            )
        ).start();
        final RtPulls pulls = new RtPulls(
            new ApacheRequest(container.home()),
            repo()
        );
        final Pull pull = pulls.get(Tv.BILLION);
        MatcherAssert.assertThat(
            new Pull.Smart(pull).title(),
View Full Code Here

                    .add(pull("Amazing new feature"))
                    .build().toString()
            )
        ).start();
        final RtPulls pulls = new RtPulls(
            new ApacheRequest(container.home()),
            repo()
        );
        MatcherAssert.assertThat(
            pulls.iterate(),
            Matchers.<Pull>iterableWithSize(2)
View Full Code Here

    public void patchesAsset() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final RtReleaseAsset asset = new RtReleaseAsset(
            new ApacheRequest(container.home()),
            release(),
            2
        );
        try {
            final JsonObject json = Json.createObjectBuilder()
View Full Code Here

    public void removesAsset() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_NO_CONTENT, "")
        ).start();
        final RtReleaseAsset asset = new RtReleaseAsset(
            new ApacheRequest(container.home()),
            release(),
            3
        );
        try {
            asset.remove();
View Full Code Here

    public void rawAsset() throws Exception {
        final MkContainer container = new MkGrizzlyContainer().next(
            new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "")
        ).start();
        final RtReleaseAsset asset = new RtReleaseAsset(
            new ApacheRequest(container.home()),
            release(),
            4
        );
        try {
            final InputStream stream = asset.raw();
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.