Package org.jboss.aerogear.controller.router.rest

Examples of org.jboss.aerogear.controller.router.rest.JsonResponder


                        .from("/ints")
                        .on(GET)
                        .produces(JSON)
                        .to(SampleController.class).findByWithDefaults(param(PaginationInfo.class), param("color"));
            }
        }).spyController(new SampleController()).addResponder(new JsonResponder());
        final InvocationResult result = routeTester.acceptHeader(JSON).processGetRequest("/ints?color=blue");
        verify(result.getRouteContext().getResponse()).setHeader(eq("Link"), anyString());
        verify(routeTester.<SampleController>getController()).findByWithDefaults(any(PaginationInfo.class), eq("blue"));
        assertThat(routeTester.getStringWriter().toString()).isEqualTo("[0,1,2,3,4,5,6,7,8,9]");
    }
View Full Code Here


                        .from("/ints")
                        .on(RequestMethod.GET)
                        .produces(JSON)
                        .to(SampleController.class).findByWithCustomHeadersDefaultPrefix(param(PaginationInfo.class), param("color"));
            }
        }).spyController(new SampleController()).addResponder(new JsonResponder());
        final InvocationResult result = routeTester.acceptHeader(JSON).processGetRequest("/ints?color=blue");
        final HttpServletResponse response = result.getRouteContext().getResponse();
        verify(routeTester.<SampleController>getController()).findByWithCustomHeadersDefaultPrefix(any(PaginationInfo.class), eq("blue"));
        verify(response).setHeader("AG-Links-Next", "http://localhost:8080/test/ints?color=blue&offset=10&limit=10");
        verify(response, never()).setHeader(eq("AG-Links-Previous"), anyString());
View Full Code Here

                        .from("/ints")
                        .on(RequestMethod.GET)
                        .produces(JSON)
                        .to(SampleController.class).findByWithCustomHeadersPrefix(param(PaginationInfo.class), param("color"));
            }
        }).addResponder(new JsonResponder()).spyController(new SampleController())
        .param("color", "blue").param("offset", "0").param("limit", "5");
        final InvocationResult result = routeTester.acceptHeader(JSON).processGetRequest("/ints");
        final HttpServletResponse response = result.getRouteContext().getResponse();
        verify(routeTester.<SampleController>getController()).findByWithCustomHeadersPrefix(any(PaginationInfo.class), eq("blue"));
        verify(response).setHeader("Test-Links-Next", "http://localhost:8080/test/ints?color=blue&offset=5&limit=5");
View Full Code Here

                        .from("/ints")
                        .on(RequestMethod.GET)
                        .produces(JSON)
                        .to(SampleController.class).findByWithCustomHeadersPrefix(param(PaginationInfo.class), param("color"));
            }
        }).addResponder(new JsonResponder()).spyController(new SampleController())
        .param("color", "blue").param("offset", "5").param("limit", "5");
        final InvocationResult result = routeTester.acceptHeader(JSON).processGetRequest("/ints");
        final HttpServletResponse response = result.getRouteContext().getResponse();
        verify(routeTester.<SampleController>getController()).findByWithCustomHeadersPrefix(any(PaginationInfo.class), eq("blue"));
        verify(response).setHeader("Test-Links-Previous", "http://localhost:8080/test/ints?color=blue&offset=0&limit=5");
View Full Code Here

                        .from("/ints")
                        .on(RequestMethod.GET)
                        .produces(JSON)
                        .to(SampleController.class).findByWithCustomParamNames(param(PaginationInfo.class), param("brand"));
            }
        }).acceptHeader(JSON).addResponder(new JsonResponder()).spyController(new SampleController());
        final InvocationResult result = routeTester.processGetRequest("/ints?brand=BMW&myoffset=50&mylimit=5");
        final HttpServletResponse response = result.getRouteContext().getResponse();
        verify(routeTester.<SampleController>getController()).findByWithCustomParamNames(any(PaginationInfo.class), eq("BMW"));
        verify(response).setHeader("TS-Links-Previous", "http://localhost:8080/test/ints?brand=BMW&myoffset=45&mylimit=5");
        verify(response, never()).setHeader(eq("TS-Links-Next"), anyString());
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.controller.router.rest.JsonResponder

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.