use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericSecureIntegrationTest method testPost.
@Test
public void testPost() throws Exception {
UrlResponse response = testUtil.doMethodSecure("POST", "/poster", "Fo shizzy");
LOGGER.info(response.body);
Assert.assertEquals(201, response.status);
Assert.assertTrue(response.body.contains("Fo shizzy"));
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testPatch.
@Test
public void testPatch() throws Exception {
UrlResponse response = testUtil.doMethod("PATCH", "/patcher", "Fo shizzy");
LOGGER.info(response.body);
Assert.assertEquals(200, response.status);
Assert.assertTrue(response.body.contains("Fo shizzy"));
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testGetRoot.
@Test
public void testGetRoot() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/", null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("Hello Root!", response.body);
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method paths_should_be_very_nestable.
@Test
public void paths_should_be_very_nestable() throws Exception {
UrlResponse response = testUtil.doMethod("GET", "/firstPath/secondPath/thirdPath/test", null, "application/json");
Assert.assertTrue(response.status == 200);
Assert.assertEquals("Very nested path-prefix works", response.body);
Assert.assertEquals("true", response.headers.get("before-filter-ran"));
}
use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.
the class GenericIntegrationTest method testEchoParamWithUpperCaseInValue.
@Test
public void testEchoParamWithUpperCaseInValue() throws Exception {
final String camelCased = "ThisIsAValueAndSparkShouldRetainItsUpperCasedCharacters";
UrlResponse response = testUtil.doMethod("GET", "/param/" + camelCased, null);
Assert.assertEquals(200, response.status);
Assert.assertEquals("echo: " + camelCased, response.body);
}
Aggregations