Make testSpecialCharacters compatible with Azure

Also sort prefix chars by hex values and remove unneeded delimiter.
pull/210/head
Andrew Gaul 2017-04-12 00:53:48 -07:00
rodzic d8546c00ce
commit b9730a4b2f
1 zmienionych plików z 8 dodań i 4 usunięć

Wyświetl plik

@ -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();