Package org.jboss.aerogear.controller.mocks

Examples of org.jboss.aerogear.controller.mocks.RouteTester


        verify(routeTester.<SampleController>getController()).find("red", "Ferrari");
    }

    @Test
    public void testHeaderAndPathParameters() throws Exception {
        final RouteTester routeTester = RouteTester.from(new AbstractRoutingModule() {
            @Override
            public void configuration() {
                route()
                        .from("/cars/{color}")
                        .on(RequestMethod.GET)
                        .produces(JSP)
                        .to(SampleController.class).find(param("color"), param("brand"));
            }
        }).acceptHeader(HTML).header("brand", "Ferrari");
        routeTester.processGetRequest("/cars/red");
        verify(routeTester.<SampleController>getController()).find("red", "Ferrari");
    }
View Full Code Here


        verify(routeTester.<SampleController>getController()).find("red", "Ferrari");
    }

    @Test
    public void testCookieParameters() throws Exception {
        final RouteTester routeTester = RouteTester.from(new AbstractRoutingModule() {
            @Override
            public void configuration() {
                route()
                        .from("/cars")
                        .on(RequestMethod.GET)
                        .produces(JSP)
                        .to(SampleController.class).find(param("color"), param("brand", "Ferrari"));
            }
        }).acceptHeader(HTML).cookie("brand", "Ferrari").cookie("color", "red");
        routeTester.processGetRequest("/cars");
        verify(routeTester.<SampleController>getController()).find("red", "Ferrari");
    }
View Full Code Here

TOP

Related Classes of org.jboss.aerogear.controller.mocks.RouteTester

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.