public void testPutInputStreamPayloadEnclosingGenerateMD5() throws SecurityException, NoSuchMethodException,
IOException {
Invokable<?, ?> method = method(TestTransformers.class, "put", PayloadEnclosing.class);
ByteSource byteSource = ByteSource.wrap("whoops".getBytes(UTF_8));
PayloadEnclosing payloadEnclosing = new PayloadEnclosingImpl(
newInputStreamPayload(byteSource.openStream()));
payloadEnclosing.getPayload().getContentMetadata().setContentLength(byteSource.size());
payloadEnclosing.getPayload().getContentMetadata().setContentMD5(byteSource.hash(Hashing.md5()).asBytes());
GeneratedHttpRequest request = processor.apply(Invocation.create(method,
ImmutableList.<Object> of(payloadEnclosing)));
assertRequestLineEquals(request, "PUT http://localhost:9999 HTTP/1.1");
assertNonPayloadHeadersEqual(request, "");