JCLOUDS-1327: Add tests for zero-length blobs

This commit is contained in:
Chaithanya Ganta 2017-07-20 18:40:26 +05:30 committed by Andrew Gaul
parent d07c4a215e
commit d6038487f7
1 changed files with 15 additions and 0 deletions

View File

@ -639,6 +639,21 @@ public class BaseBlobIntegrationTest extends BaseBlobStoreIntegrationTest {
testPut(payload, null, new ByteSourcePayload(byteSource), length, new PutOptions()); testPut(payload, null, new ByteSourcePayload(byteSource), length, new PutOptions());
} }
@Test(groups = { "integration", "live" })
public void testPutZeroLengthByteSource() throws Exception {
long length = 0;
Payload payload = new ByteSourcePayload(ByteSource.empty());
testPut(payload, null, payload, length, new PutOptions());
}
@Test(groups = { "integration", "live" })
public void testPutZeroLengthInputStream() throws Exception {
long length = 0;
ByteSource byteSource = ByteSource.empty();
Payload payload = new InputStreamPayload(byteSource.openStream());
testPut(payload, null, payload, length, new PutOptions());
}
@Test(groups = { "integration", "live" }) @Test(groups = { "integration", "live" })
public void testPutMultipartByteSource() throws Exception { public void testPutMultipartByteSource() throws Exception {
long length = Math.max(getMinimumMultipartBlobSize(), MultipartUploadSlicingAlgorithm.DEFAULT_PART_SIZE + 1); long length = Math.max(getMinimumMultipartBlobSize(), MultipartUploadSlicingAlgorithm.DEFAULT_PART_SIZE + 1);