public void testResourcePut() throws IOException {
server.setMockResponseCode(200);
RestClient client = getRestClient();
Resource resource = client.resource(serviceURL + "/testResourcePut");
String response =
resource.contentType("text/plain").accept("text/plain").put(String.class, SENT_MESSAGE);
assertEquals(RECEIVED_MESSAGE, response);
assertEquals(SENT_MESSAGE, server.getRequestContentAsString());
// do put with response
ClientResponse clientResponse = resource.put(SENT_MESSAGE);