{
final String body = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><category><categoryId>5</categoryId><name>" + resourcePath.hashCode() + "</name></category>";
final String mediaType = "application/xml";
final String path = "/restv1" + resourcePath + "/5";
new ResourceRequest(new ResourceRequestEnvironment(this), Method.PUT, path)
{
@Override
protected void prepareRequest(EnhancedMockHttpServletRequest request)
{
super.prepareRequest(request);
request.setContentType(mediaType);
request.addHeader("Content-Type", mediaType);
request.setContent(body.getBytes());
}
@Override
protected void onResponse(EnhancedMockHttpServletResponse response)
{
assertEquals(response.getStatus(), 204, "Unexpected response code.");
}
}.run();
reset();
new ResourceRequest(new ResourceRequestEnvironment(this), Method.GET, path)
{
@Override
protected void prepareRequest(EnhancedMockHttpServletRequest request)
{