use of com.meterware.httpunit.HeaderOnlyWebRequest in project camel by apache.
the class RestServletVerbTest method testDelete.
@Test
public void testDelete() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:delete");
mock.expectedHeaderReceived("id", "1");
mock.expectedHeaderReceived(Exchange.HTTP_METHOD, "DELETE");
WebRequest req = new HeaderOnlyWebRequest(CONTEXT_URL + "/services/users/1") {
@Override
public String getMethod() {
return "DELETE";
}
};
ServletUnitClient client = newClient();
client.setExceptionsThrownOnErrorStatus(false);
WebResponse response = client.getResponse(req);
assertEquals(200, response.getResponseCode());
assertMockEndpointsSatisfied();
}
Aggregations