RestResponse r = createResponse(ContentType.XML, "<xml />");
return r;
}
private RestResponse createResponse(ContentType contentType, String body) {
RestResponse response = new RestResponse();
response.setResource("/resources");
response.setStatusCode(200);
response.setStatusText("OK");
response.setBody(body);
response.addHeader("Content-Type", contentType.toMime().get(0));
response.addHeader("Bespoke-Header", "jolly");
response.addHeader("Bespoke-Header", "good");
response.addHeader("Content-Length", "7");
response.setTransactionId(123456789L);
return response;
}