Package com.jcabi.http

Examples of com.jcabi.http.Request


        final String jessy = "Jessy";
        final MkContainer container = new MkGrizzlyContainer().next(
            RtValuePaginationTest.simple(jeff, mark)
                .withHeader("Link", "</s?page=3&per_page=100>; rel=\"next\"")
        ).next(RtValuePaginationTest.simple(judy, jessy)).start();
        final Request request = new ApacheRequest(container.home());
        final RtValuePagination<JsonObject, JsonArray> page =
            new RtValuePagination<JsonObject, JsonArray>(
                request,
                new RtValuePagination.Mapping<JsonObject, JsonArray>() {
                    @Override
View Full Code Here


        final String mark = "other Mark";
        final MkContainer container = new MkGrizzlyContainer().next(
            RtValuePaginationTest.simple(jeff, mark)
        ).start();
        try {
            final Request request = new ApacheRequest(container.home());
            final RtValuePagination<JsonObject, JsonArray> page =
                new RtValuePagination<JsonObject, JsonArray>(
                    request,
                    new RtValuePagination.Mapping<JsonObject, JsonArray>() {
                        @Override
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

     * @throws Exception If some problem inside
     */
    @Test
    public void cachesJsonData() throws Exception {
        final Comment origin = Mockito.mock(Comment.class);
        final Request request = new FakeRequest()
            .withBody("[{\"body\": \"hey you\"}]");
        final Comment comment = new Bulk<Comment>(
            new RtPagination<Comment>(
                request,
                new RtPagination.Mapping<Comment, JsonObject>() {
View Full Code Here

    @NotNull(message = "Iterable of pull comments is never NULL")
    public Iterable<PullComment> iterate(
        @NotNull(message = "number can't be NULL") final int number,
        @NotNull(message = "params can't be NULL")
        final Map<String, String> params) {
        final Request newreq = this.entry.uri()
            .path("/repos")
            .path(this.owner.repo().coordinates().user())
            .path(this.owner.repo().coordinates().repo())
            .path("/pulls")
            .path(String.valueOf(number))
            .path("/comments")
            .back();
        return new RtPagination<PullComment>(
            newreq.uri().queryParams(params).back(),
            new RtPagination.Mapping<PullComment, JsonObject>() {
                @Override
                public PullComment map(final JsonObject value) {
                    return RtPullComments.this.get(
                        value.getInt("id")
View Full Code Here

TOP

Related Classes of com.jcabi.http.Request

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.