jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Gaul <notificati...@github.com>
Subject Re: [jclouds] JCLOUDS-184: Improving AzureBlob unit tests for AzureBlobBlockUploadStrategyTest (#320)
Date Wed, 19 Mar 2014 22:56:31 GMT
> +
> +   @Test(expectedExceptions = IllegalArgumentException.class)
> +   public void testExceededContentLengthLimit() throws Exception {
> +      String container = "test-container";
> +      String blobName = "test-blob";
> +
> +      AzureBlobClient client = createNiceMock(AzureBlobClient.class);
> +      PayloadSlicer slicer = createNiceMock(PayloadSlicer.class);
> +
> +      MutableBlobMetadata metadata = new MutableBlobMetadataImpl();
> +      MutableContentMetadata contentMetadata = new BaseMutableContentMetadata();
> +      contentMetadata.setContentLength(MultipartUploadStrategy.MAX_BLOCK_SIZE * MultipartUploadStrategy.MAX_NUMBER_OF_BLOCKS
+ 1);
> +      metadata.setName(blobName);
> +      metadata.setContentMetadata(contentMetadata);
> +      Blob blob = new BlobImpl(metadata);
> +      Payload payload = new StringPayload("ABCD");

Could you use a ByteSourcePayload instead?  We deprecated StringPayload in 1.8.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/320/files#r10776003
Mime
View raw message