Examples of UrlResponse


Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testEchoParam2() {
        try {
            UrlResponse response = testUtil.doMethodSecure("GET", "/gunit",
                                                           null);
            Assert.assertEquals(200, response.status);
            Assert.assertEquals("echo: gunit", response.body);
        } catch (Throwable e) {
            throw new RuntimeException(e);
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testEchoParamWithMaj() {
        try {
            UrlResponse response = testUtil.doMethodSecure("GET",
                                                           "/paramwithmaj/plop", null);
            Assert.assertEquals(200, response.status);
            Assert.assertEquals("echo: plop", response.body);
        } catch (Throwable e) {
            throw new RuntimeException(e);
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testUnauthorized() throws Exception {
        try {
            UrlResponse urlResponse = testUtil.doMethodSecure("GET", "/protected/resource", null);
            Assert.assertTrue(urlResponse.status == 401);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testNotFound() throws Exception {
        try {
            UrlResponse urlResponse = testUtil.doMethodSecure("GET", "/no/resource", null);
            Assert.assertTrue(urlResponse.status == 404);
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testPost() {
        try {
            UrlResponse response = testUtil.doMethodSecure("POST", "/poster",
                                                           "Fo shizzy");
            LOGGER.info(response.body);
            Assert.assertEquals(201, response.status);
            Assert.assertTrue(response.body.contains("Fo shizzy"));
        } catch (Throwable e) {
View Full Code Here

Examples of spark.util.SparkTestUtil.UrlResponse

    }

    @Test
    public void testPatch() {
        try {
            UrlResponse response = testUtil.doMethodSecure("PATCH", "/patcher",
                                                           "Fo shizzy");
            LOGGER.info(response.body);
            Assert.assertEquals(200, response.status);
            Assert.assertTrue(response.body.contains("Fo shizzy"));
        } catch (Throwable 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.