kopia lustrzana https://github.com/gaul/s3proxy
Make testSpecialCharacters compatible with Azure
Also sort prefix chars by hex values and remove unneeded delimiter.pull/210/head
rodzic
d8546c00ce
commit
b9730a4b2f
|
@ -561,10 +561,15 @@ public final class AwsSdkTest {
|
|||
|
||||
@Test
|
||||
public void testSpecialCharacters() throws Exception {
|
||||
String prefix = "special ~`!@#$%^&*()-_+=[]{}\\|;:'\"<>,./?";
|
||||
if (blobStoreType.equals("b2")) {
|
||||
String prefix = "special !\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";
|
||||
if (blobStoreType.equals("azureblob") || blobStoreType.equals("b2")) {
|
||||
prefix = prefix.replace("\\", "");
|
||||
}
|
||||
if (blobStoreType.equals("azureblob")) {
|
||||
// Avoid blob names that end with a dot (.), a forward slash (/), or
|
||||
// a sequence or combination of the two.
|
||||
prefix = prefix.replace("./", "/") + ".";
|
||||
}
|
||||
String blobName = prefix + "foo";
|
||||
ObjectMetadata metadata = new ObjectMetadata();
|
||||
metadata.setContentLength(BYTE_SOURCE.size());
|
||||
|
@ -573,8 +578,7 @@ public final class AwsSdkTest {
|
|||
|
||||
ObjectListing listing = client.listObjects(new ListObjectsRequest()
|
||||
.withBucketName(containerName)
|
||||
.withPrefix(prefix)
|
||||
.withDelimiter("/"));
|
||||
.withPrefix(prefix));
|
||||
List<S3ObjectSummary> summaries = listing.getObjectSummaries();
|
||||
assertThat(summaries).hasSize(1);
|
||||
S3ObjectSummary summary = summaries.iterator().next();
|
||||
|
|
Ładowanie…
Reference in New Issue