Package com.jetdrone.vertx.yoke.test

Examples of com.jetdrone.vertx.yoke.test.YokeTester.request()


            int some200 = 0;
            int some503 = 0;

            @Override
            public void handle(Long event) {
                tester.request("GET", "/", new Handler<Response>() {
                    @Override
                    public void handle(Response response) {
                        if (response.getStatusCode() == 200) {
                            some200++;
                        }
View Full Code Here


            });
        }});

        final YokeTester yokeAssert = new YokeTester(yoke);

        yokeAssert.request("GET", "/api", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());

                yokeAssert.request("GET", "/api/", new Handler<Response>() {
View Full Code Here

        yokeAssert.request("GET", "/api", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());

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

            });
        }});

        final YokeTester yokeAssert = new YokeTester(yoke);

        yokeAssert.request("GET", "/api-stable", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(200, resp.getStatusCode());
                testComplete();
            }
View Full Code Here

        });

        final YokeTester yokeAssert = new YokeTester(yoke);

        // first time is forbidden
        yokeAssert.request("GET", "/", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(401, resp.getStatusCode());
                assertNotNull(resp.headers.get("www-authenticate"));
View Full Code Here

                // second time send the authorization header
                MultiMap headers = new CaseInsensitiveMultiMap();
                headers.add("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");

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

        });

        final YokeTester yokeAssert = new YokeTester(yoke);

        // first time is forbidden
        yokeAssert.request("GET", "/", new Handler<Response>() {
            @Override
            public void handle(Response resp) {
                assertEquals(401, resp.getStatusCode());
                assertNotNull(resp.headers.get("www-authenticate"));
View Full Code Here

                // second time send the authorization header
                MultiMap headers = new CaseInsensitiveMultiMap();
                headers.add("authorization", "Basic QWxhZGRpbjo=");

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

            }
        });

        final YokeTester tester = new YokeTester(app);

        tester.request("GET", "/", new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.body.toString(), "hello");

                tester.request("GET", "/crossdomain.xml", new Handler<Response>() {
View Full Code Here

        tester.request("GET", "/", new Handler<Response>() {
            @Override
            public void handle(Response response) {
                assertEquals(response.body.toString(), "hello");

                tester.request("GET", "/crossdomain.xml", new Handler<Response>() {
                    @Override
                    public void handle(Response response) {
                        assertEquals(response.headers().get("Content-Type"), "text/x-cross-domain-policy");
                        assertEquals(response.body.toString(), "<?xml version=\"1.0\"?>" +
                                "<!DOCTYPE cross-domain-policy SYSTEM \"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd\">" +
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.