use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testGetHiAfterFilter.
@Test
public void testGetHiAfterFilter() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/hi", null);
Assert.assertTrue(response.headers.get("after").contains("foobar"));
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testExceptionMapper.
@Test
public void testExceptionMapper() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/throwexception", null);
Assert.assertEquals("Exception handled", response.body);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testRuntimeExceptionForDone.
@Test
public void testRuntimeExceptionForDone() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/exception", null);
Assert.assertEquals("done executed for exception", response.body);
Assert.assertEquals(500, response.status);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testEchoParam1.
@Test
public void testEchoParam1() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/param/shizzy", null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("echo: shizzy", response.body);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testNotFoundExceptionMapper.
@Test
public void testNotFoundExceptionMapper() throws Exception {
// thrownotfound
UrlResponse response = testUtil.doMethod("GET", "/thrownotfound", null);
Assert.assertEquals(NOT_FOUND_BRO, response.body);
Assert.assertEquals(404, response.status);
}
Aggregations