mirror of https://github.com/apache/jclouds.git
Add BaseBlobIntegrationTest.testSetBlobAccess
Similar to BaseContainerIntegrationTest.testSetContainerAccess.
This commit is contained in:
parent
40f31786c5
commit
52dc1a3ccf
|
@ -189,6 +189,6 @@ public class FilesystemContainerIntegrationTest extends BaseContainerIntegration
|
|||
@Override
|
||||
@Test(groups = { "integration", "live" })
|
||||
public void testSetContainerAccess() throws Exception {
|
||||
throw new SkipException("transient does not support anonymous access");
|
||||
throw new SkipException("filesystem does not support anonymous access");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,10 +18,17 @@ package org.jclouds.blobstore.integration;
|
|||
|
||||
import org.jclouds.blobstore.integration.internal.BaseBlobIntegrationTest;
|
||||
import org.testng.annotations.Test;
|
||||
import org.testng.SkipException;
|
||||
|
||||
@Test(groups = { "integration" })
|
||||
public class TransientBlobIntegrationTest extends BaseBlobIntegrationTest {
|
||||
public TransientBlobIntegrationTest() {
|
||||
provider = "transient";
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test(groups = { "integration", "live" })
|
||||
public void testSetBlobAccess() throws Exception {
|
||||
throw new SkipException("transient does not support anonymous access");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,6 +85,6 @@ public class TransientContainerIntegrationTest extends BaseContainerIntegrationT
|
|||
@Override
|
||||
@Test(groups = { "integration", "live" })
|
||||
public void testSetContainerAccess() throws Exception {
|
||||
throw new SkipException("filesystem does not support anonymous access");
|
||||
throw new SkipException("transient does not support anonymous access");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -65,6 +65,8 @@ import org.jclouds.blobstore.options.PutOptions;
|
|||
import org.jclouds.blobstore.strategy.internal.MultipartUploadSlicingAlgorithm;
|
||||
import org.jclouds.crypto.Crypto;
|
||||
import org.jclouds.encryption.internal.JCECrypto;
|
||||
import org.jclouds.http.HttpRequest;
|
||||
import org.jclouds.http.HttpResponse;
|
||||
import org.jclouds.http.HttpResponseException;
|
||||
import org.jclouds.io.ByteStreams2;
|
||||
import org.jclouds.io.ContentMetadataBuilder;
|
||||
|
@ -667,6 +669,12 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
|
|||
blobStore.setBlobAccess(containerName, blobName, BlobAccess.PUBLIC_READ);
|
||||
assertThat(blobStore.getBlobAccess(containerName, blobName)).isEqualTo(BlobAccess.PUBLIC_READ);
|
||||
|
||||
// test that blob is anonymously readable
|
||||
HttpRequest request = view.getSigner().signGetBlob(containerName, blobName).toBuilder()
|
||||
.replaceQueryParams(ImmutableMap.<String, String>of()).build();
|
||||
HttpResponse response = view.utils().http().invoke(request);
|
||||
assertThat(response.getStatusCode()).isEqualTo(200);
|
||||
|
||||
blobStore.setBlobAccess(containerName, blobName, BlobAccess.PRIVATE);
|
||||
assertThat(blobStore.getBlobAccess(containerName, blobName)).isEqualTo(BlobAccess.PRIVATE);
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue