use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class FilterTest method testJustFilter.
@Test
public void testJustFilter() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/justfilter", null);
System.out.println("response.status = " + response.status);
Assert.assertEquals(404, response.status);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testGetInputStreamHi.
@Test
public void testGetInputStreamHi() {
try {
UrlResponse response = testUtil.doMethod("GET", "/inputstreamhi", null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("Hello World!", response.body);
} catch (Throwable e) {
throw new RuntimeException(e);
}
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class ResponseWrapperDelegationTest method filters_can_detect_response_status.
@Test
public void filters_can_detect_response_status() throws Exception {
UrlResponse response = testUtil.get("/204");
Assert.assertEquals(200, response.status);
Assert.assertEquals("ok", response.body);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class ResponseWrapperDelegationTest method filters_can_detect_content_type.
@Test
public void filters_can_detect_content_type() throws Exception {
UrlResponse response = testUtil.get("/json");
Assert.assertEquals(200, response.status);
Assert.assertEquals("{\"status\": \"ok\"}", response.body);
Assert.assertEquals("text/plain", response.headers.get("Content-Type"));
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class ServletTest method testEchoParam2.
@Test
public void testEchoParam2() throws Exception {
UrlResponse response = testUtil.doMethod("GET", SOMEPATH + "/gunit", null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("echo: gunit", response.body);
}
Aggregations