public void throwsWhenFailedToRead() throws Exception {
final S3ObjectInputStream stream =
Mockito.mock(S3ObjectInputStream.class);
Mockito.doThrow(new IOException("oops"))
.when(stream).read(Mockito.any(byte[].class));
final AmazonS3 client = Mockito.mock(AmazonS3.class);
final S3Object object = Mockito.mock(S3Object.class);
Mockito.doReturn(object).when(client)
.getObject(Mockito.any(GetObjectRequest.class));
Mockito.doReturn(stream).when(object).getObjectContent();
MatcherAssert.assertThat(