@Test
public void testBlobList() throws Exception {
assertThat(s3BlobStore.list(containerName)).isEmpty();
// TODO: hang with zero length blobs?
ByteSource byteSource = ByteSource.wrap(new byte[1]);
ImmutableSet.Builder<String> builder = ImmutableSet.builder();
Blob blob1 = s3BlobStore.blobBuilder("blob1")
.payload(byteSource)
.contentLength(byteSource.size())
.build();
s3BlobStore.putBlob(containerName, blob1);
for (StorageMetadata metadata : s3BlobStore.list(containerName)) {
builder.add(metadata.getName());
}
assertThat(builder.build()).containsOnly("blob1");
builder = ImmutableSet.builder();
Blob blob2 = s3BlobStore.blobBuilder("blob2")
.payload(byteSource)
.contentLength(byteSource.size())
.build();
s3BlobStore.putBlob(containerName, blob2);
for (StorageMetadata metadata : s3BlobStore.list(containerName)) {
builder.add(metadata.getName());
}