Search in sources :

Example 11 with UrlResponse

use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.

the class GenericSecureIntegrationTest method testPatch.

@Test
public void testPatch() throws Exception {
    UrlResponse response = testUtil.doMethodSecure("PATCH", "/patcher", "Fo shizzy");
    LOGGER.info(response.body);
    Assert.assertEquals(200, response.status);
    Assert.assertTrue(response.body.contains("Fo shizzy"));
}
Also used : UrlResponse(spark.util.SparkTestUtil.UrlResponse) Test(org.junit.Test)

Example 12 with UrlResponse

use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.

the class GenericSecureIntegrationTest method testEchoParamWithMaj.

@Test
public void testEchoParamWithMaj() throws Exception {
    UrlResponse response = testUtil.doMethodSecure("GET", "/paramwithmaj/plop", null);
    Assert.assertEquals(200, response.status);
    Assert.assertEquals("echo: plop", response.body);
}
Also used : UrlResponse(spark.util.SparkTestUtil.UrlResponse) Test(org.junit.Test)

Example 13 with UrlResponse

use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.

the class GenericSecureIntegrationTest method testEchoParam2.

@Test
public void testEchoParam2() throws Exception {
    UrlResponse response = testUtil.doMethodSecure("GET", "/gunit", null);
    Assert.assertEquals(200, response.status);
    Assert.assertEquals("echo: gunit", response.body);
}
Also used : UrlResponse(spark.util.SparkTestUtil.UrlResponse) Test(org.junit.Test)

Example 14 with UrlResponse

use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.

the class GenericSecureIntegrationTest method testHiHead.

@Test
public void testHiHead() throws Exception {
    UrlResponse response = testUtil.doMethodSecure("HEAD", "/hi", null);
    Assert.assertEquals(200, response.status);
    Assert.assertEquals("", response.body);
}
Also used : UrlResponse(spark.util.SparkTestUtil.UrlResponse) Test(org.junit.Test)

Example 15 with UrlResponse

use of spark.util.SparkTestUtil.UrlResponse in project spark by perwendel.

the class GenericSecureIntegrationTest method testEchoParam1.

@Test
public void testEchoParam1() throws Exception {
    UrlResponse response = testUtil.doMethodSecure("GET", "/shizzy", null);
    Assert.assertEquals(200, response.status);
    Assert.assertEquals("echo: shizzy", response.body);
}
Also used : UrlResponse(spark.util.SparkTestUtil.UrlResponse) Test(org.junit.Test)

Aggregations

UrlResponse (spark.util.SparkTestUtil.UrlResponse)66 Test (org.junit.Test)65 HashMap (java.util.HashMap)3 JWGmeligMeylingException (spark.examples.exception.JWGmeligMeylingException)1