use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class ServletTest method testGetHiAfterFilter.
@Test
public void testGetHiAfterFilter() throws Exception {
UrlResponse response = testUtil.doMethod("GET", SOMEPATH + "/hi", null);
Assert.assertTrue(response.headers.get("after").contains("foobar"));
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class ServletTest method testExternalStaticFile.
@Test
public void testExternalStaticFile() throws Exception {
UrlResponse response = testUtil.doMethod("GET", SOMEPATH + "/" + MyApp.EXTERNAL_FILE, 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 ServletTest method testStaticResource.
@Test
public void testStaticResource() throws Exception {
UrlResponse response = testUtil.doMethod("GET", SOMEPATH + "/css/style.css", null);
Assert.assertEquals(200, response.status);
Assert.assertTrue(response.body.contains("Content of css file"));
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericSecureIntegrationTest method testNotFound.
@Test
public void testNotFound() throws Exception {
UrlResponse urlResponse = testUtil.doMethodSecure("GET", "/no/resource", null);
Assert.assertTrue(urlResponse.status == 404);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericSecureIntegrationTest method testGetRoot.
@Test
public void testGetRoot() throws Exception {
UrlResponse response = testUtil.doMethodSecure("GET", "/", null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("Hello Root!", response.body);
}
Aggregations