// Test partial Get.
Request request = new Request(Method.PUT, "http://localhost:"
+ TEST_PORT + "/");
StringRepresentation rep = new StringRepresentation("0123456789");
try {
DigesterRepresentation digester = new DigesterRepresentation(rep);
// Such representation computes the digest while
// consuming the wrapped representation.
digester.exhaust();
// Set the digest with the computed one
digester.setDigest(digester.computeDigest());
request.setEntity(digester);
Response response = client.handle(request);
assertEquals(Status.SUCCESS_OK, response.getStatus());
digester = new DigesterRepresentation(response.getEntity());
digester.exhaust();
assertTrue(digester.checkDigest());
client.stop();
} catch (Exception e) {
fail(e.getMessage());
}