use of com.meterware.httpunit.GetMethodWebRequest in project camel by apache.
the class ServletSetBodyTest method testSetBody.
@Test
public void testSetBody() throws Exception {
WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/hello");
ServletUnitClient client = newClient();
WebResponse response = client.getResponse(req);
assertEquals("The response message is wrong ", "Bye World", response.getText());
}
use of com.meterware.httpunit.GetMethodWebRequest in project camel by apache.
the class RestServletGetTest method testServletProducerGet.
@Test
public void testServletProducerGet() throws Exception {
WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/users/123/basic");
ServletUnitClient client = newClient();
client.setExceptionsThrownOnErrorStatus(false);
WebResponse response = client.getResponse(req);
assertEquals(200, response.getResponseCode());
assertEquals("123;Donald Duck", response.getText());
}
use of com.meterware.httpunit.GetMethodWebRequest in project camel by apache.
the class RestServletGetWildcardsTest method testServletProducerGet.
@Test
public void testServletProducerGet() throws Exception {
WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/users/123/basic");
ServletUnitClient client = newClient();
client.setExceptionsThrownOnErrorStatus(false);
WebResponse response = client.getResponse(req);
assertEquals(200, response.getResponseCode());
assertEquals("123;Donald Duck", response.getText());
}
use of com.meterware.httpunit.GetMethodWebRequest in project camel by apache.
the class RestServletGetWildcardsTest method testServletProducerGetWildcards.
@Test
public void testServletProducerGetWildcards() throws Exception {
WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/users/456/name=g*");
ServletUnitClient client = newClient();
client.setExceptionsThrownOnErrorStatus(false);
WebResponse response = client.getResponse(req);
assertEquals(200, response.getResponseCode());
assertEquals("456;Goofy", response.getText());
}
use of com.meterware.httpunit.GetMethodWebRequest in project camel by apache.
the class RestServletPojoInOutTest method testServletPojoGet.
@Test
public void testServletPojoGet() throws Exception {
WebRequest req = new GetMethodWebRequest(CONTEXT_URL + "/services/users/lives");
ServletUnitClient client = newClient();
client.setExceptionsThrownOnErrorStatus(false);
WebResponse response = client.getResponse(req);
assertEquals(200, response.getResponseCode());
String out = response.getText();
assertNotNull(out);
assertEquals("{\"iso\":\"EN\",\"country\":\"England\"}", out);
}
Aggregations