예제 #1
0
  public void testPutWithReducedRedundancyStorage() throws InterruptedException {
    String containerName = getContainerName();
    try {
      String blobName = "test-rrs";
      BlobStore blobStore = view.getBlobStore();
      blobStore.createContainerInLocation(null, containerName);

      Blob blob = blobStore.blobBuilder(blobName).payload("something").build();
      blobStore.putBlob(containerName, blob, storageClass(StorageClass.REDUCED_REDUNDANCY));

      S3Client s3Client = S3Client.class.cast(view.unwrap(AWSS3ApiMetadata.CONTEXT_TOKEN).getApi());
      ListBucketResponse response = s3Client.listBucket(containerName, withPrefix(blobName));

      ObjectMetadata metadata = response.iterator().next();
      assertEquals(metadata.getStorageClass(), StorageClass.REDUCED_REDUNDANCY);

    } finally {
      returnContainer(containerName);
    }
  }