> + public void testPutCorrectContentMD5() throws InterruptedException,
> IOException {
> + byte[] payload = ByteStreams.toByteArray(createTestInput(1024));
> + HashCode contentMD5 = md5().hashBytes(payload);
> + putBlobWithMd5(payload, contentMD5);
> + }
> +
> + @Test(groups = { "integration", "live" })
> + public void testPutIncorrectContentMD5() throws InterruptedException,
> IOException {
> + byte[] payload = ByteStreams.toByteArray(createTestInput(1024));
> + HashCode contentMD5 = md5().hashBytes(new byte[0]);
> + try {
> + putBlobWithMd5(payload, contentMD5);
> + fail();
> + } catch (HttpResponseException hre) {
> + if (hre.getResponse().getStatusCode() !=
> getIncorrectContentMD5StatusCode()) {
> + throw hre;
Rethrowing the exception seems superior to me, giving the complete backtrace
instead of an error message.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/148/files#r6315706