Package spark.util.SparkTestUtil

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


    }

    @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

    }

    @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

    }

    @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

Related Classes of spark.util.SparkTestUtil.UrlResponse

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.