Examples of UrlResponse


Examples of org.apache.cocoon.rest.controller.response.URLResponse

        data.put("id", this.id);
        data.put("name", this.name);
        data.put("reqparam", this.reqparam);
        data.put("testProperty", this.settings.getProperty("testProperty"));

        return new URLResponse("servlet:/controller/screen", data);
    }
View Full Code Here

Examples of org.apache.cocoon.rest.controller.response.URLResponse

        data.put("id", this.id);
        data.put("name", this.name);
        data.put("reqparam", this.reqparam);
        data.put("testProperty", this.settings.getProperty("testProperty"));

        return new URLResponse("servlet:/controller/screen", data);
    }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void filters_should_be_accept_type_aware() throws Exception {
        try {
            UrlResponse response = testUtil.doMethod("GET", "/protected/resource", null, "application/json");
            Assert.assertTrue(response.status == 401);
            Assert.assertEquals("{\"message\": \"Go Away!\"}", response.body);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

        }
    }

    @Test
    public void routes_should_be_accept_type_aware() throws Exception {
        UrlResponse response = testUtil.doMethod("GET", "/hi", null, "application/json");
        Assert.assertEquals(200, response.status);
        Assert.assertEquals("{\"message\": \"Hello World\"}", response.body);
    }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

        Assert.assertEquals("{\"message\": \"Hello World\"}", response.body);
    }

    @Test
    public void template_view_should_be_rendered_with_given_model_view_object() throws Exception {
        UrlResponse response = testUtil.doMethod("GET", "/templateView", null);
        Assert.assertEquals(200, response.status);
        Assert.assertEquals("Hello from my view", response.body);
    }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testGetHi() {
        try {
            UrlResponse response = testUtil.doMethod("GET", "/hi", null);
            Assert.assertEquals(200, response.status);
            Assert.assertEquals("Hello World!", response.body);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testHiHead() {
        try {
            UrlResponse response = testUtil.doMethod("HEAD", "/hi", null);
            Assert.assertEquals(200, response.status);
            Assert.assertEquals("", response.body);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testGetHiAfterFilter() {
        try {
            UrlResponse response = testUtil.doMethod("GET", "/hi", null);
            Assert.assertTrue(response.headers.get("after").contains("foobar"));
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testGetRoot() {
        try {
            UrlResponse response = testUtil.doMethod("GET", "/", null);
            Assert.assertEquals(200, response.status);
            Assert.assertEquals("Hello Root!", response.body);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testParamAndWild() {
        try {
            UrlResponse response = testUtil.doMethod("GET", "/paramandwild/thedude/stuff/andits", null);
            Assert.assertEquals(200, response.status);
            Assert.assertEquals("paramandwild: thedudeandits", response.body);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
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.