Package com.jetdrone.vertx.yoke.test

Examples of com.jetdrone.vertx.yoke.test.YokeTester


        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("content-type", "application/json");
        headers.add("transfer-encoding", "chunked");

        new YokeTester(yoke).request("POST", "/upload", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(413, resp.getStatusCode());
                testComplete();
            }
View Full Code Here


        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("content-type", "plain/text");
        headers.add("transfer-encoding", "chunked");

        new YokeTester(yoke).request("POST", "/upload", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(413, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("content-type", HttpHeaders.Values.APPLICATION_X_WWW_FORM_URLENCODED);
        headers.add("transfer-encoding", "chunked");

        new YokeTester(yoke).request("POST", "/upload", headers, body, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(413, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

        MultiMap headers = new CaseInsensitiveMultiMap();
        headers.add("Content-Type", "application/json");
        headers.add("Content-Length", "0");

        new YokeTester(yoke).request("DELETE", "/delete", headers, new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(204, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

                    request.put("name", "Paulo");
                    request.response().render(location, next);
                }
            });

            new YokeTester(yoke).request("GET", "/", new Handler<Response>() {
                @Override
                public void handle(Response resp) {
                    assertEquals(200, resp.getStatusCode());
                    assertEquals("<h1>Paulo</h1>", resp.body.toString());
                    testComplete();
View Full Code Here

                    request.put("alphabetical", list);
                    request.response().render(location, next);
                }
            });

            new YokeTester(yoke).request("GET", "/", new Handler<Response>() {
                @Override
                public void handle(Response resp) {
                    assertEquals(200, resp.getStatusCode());
                    assertEquals("<p><a href=\"a\">b</a><a href=\"c\">d</a></p>", resp.body.toString());
                    testComplete();
View Full Code Here

                    request.put("name", "Paulo");
                    request.response().render(location, next);
                }
            });

            new YokeTester(yoke).request("GET", "/", new Handler<Response>() {
                @Override
                public void handle(Response resp) {
                    assertEquals(200, resp.getStatusCode());
                    assertEquals("Hello Paulo!", resp.body.toString());
                    testComplete();
View Full Code Here

                    request.put("name", "Paulo");
                    request.response().render(location, next);
                }
            });

            new YokeTester(yoke).request("GET", "/", new Handler<Response>() {
                @Override
                public void handle(Response resp) {
                    assertEquals(200, resp.getStatusCode());
                    assertEquals("Hello Paulo Lopes!", resp.body.toString());
                    testComplete();
View Full Code Here

            public void handle(YokeRequest request) {
                // noop to so the response would never end
            }
        });

        new YokeTester(yoke).request("GET", "/", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(408, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

    @Test
    public void testAnnotatedRouter() {
        Yoke yoke = new Yoke(this);
        yoke.use(com.jetdrone.vertx.yoke.middleware.Router.from(new TestRouter()));

        new YokeTester(yoke).request("GET", "/ws", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                assertEquals("Hello ws!", resp.body.toString());
                testComplete();
View Full Code Here

TOP

Related Classes of com.jetdrone.vertx.yoke.test.YokeTester

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.