use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testParamAndWild.
@Test
public void testParamAndWild() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/paramandwild/thedude/stuff/andits", null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("paramandwild: thedudeandits", response.body);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testHiHead.
@Test
public void testHiHead() throws Exception {
UrlResponse response = testUtil.doMethod("HEAD", "/hi", null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("", response.body);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testInheritanceExceptionMapper.
@Test
public void testInheritanceExceptionMapper() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/throwsubclassofbaseexception", null);
Assert.assertEquals("Exception handled", response.body);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testExternalStaticFile.
@Test
public void testExternalStaticFile() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/externalFile.html", null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("Content of external file", response.body);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testTypedExceptionMapper.
@Test
public void testTypedExceptionMapper() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/throwmeyling", null);
Assert.assertEquals(new JWGmeligMeylingException().trustButVerify(), response.body);
}
Aggregations