// Retrieve object to ensure it was correctly created.
basicObject = s3Service.getObject(bucket, object.getKey());
assertEquals("Unexpected default content type", Mimetypes.MIMETYPE_OCTET_STREAM,
basicObject.getContentType());
assertEquals("Unexpected size for 'empty' object", 0, basicObject.getContentLength());
basicObject.closeDataInputStream();
// Make sure bucket cannot be removed while it has contents.
try {
s3Service.deleteBucket(bucket.getName());
fail("Cannot delete a bucket containing objects");