diff --git a/sdk/spring/azure-spring-cloud-storage/src/main/java/com/microsoft/azure/spring/cloud/storage/BlobStorageResource.java b/sdk/spring/azure-spring-cloud-storage/src/main/java/com/microsoft/azure/spring/cloud/storage/BlobStorageResource.java index a835acfc8532e..fe8f3ae410233 100644 --- a/sdk/spring/azure-spring-cloud-storage/src/main/java/com/microsoft/azure/spring/cloud/storage/BlobStorageResource.java +++ b/sdk/spring/azure-spring-cloud-storage/src/main/java/com/microsoft/azure/spring/cloud/storage/BlobStorageResource.java @@ -61,7 +61,7 @@ public OutputStream getOutputStream() throws IOException { throw new FileNotFoundException("The blob was not found: " + this.location); } } - return this.blockBlobClient.getBlobOutputStream(); + return this.blockBlobClient.getBlobOutputStream(true); } catch (BlobStorageException e) { LOG.error(MSG_FAIL_OPEN_OUTPUT, e); throw new IOException(MSG_FAIL_OPEN_OUTPUT, e); diff --git a/sdk/spring/azure-spring-cloud-storage/src/test/java/com/microsoft/azure/spring/cloud/storage/AzureBlobStorageTests.java b/sdk/spring/azure-spring-cloud-storage/src/test/java/com/microsoft/azure/spring/cloud/storage/AzureBlobStorageTests.java index f985f20f956e3..3056b035fb065 100644 --- a/sdk/spring/azure-spring-cloud-storage/src/test/java/com/microsoft/azure/spring/cloud/storage/AzureBlobStorageTests.java +++ b/sdk/spring/azure-spring-cloud-storage/src/test/java/com/microsoft/azure/spring/cloud/storage/AzureBlobStorageTests.java @@ -162,7 +162,7 @@ public static BlobServiceClientBuilder mockBlobServiceClientBuilder() { when(nonExistingBlockBlob.getBlobName()).thenReturn(NON_EXISTING); when(blockBlob.openInputStream()).thenReturn(mock(BlobInputStream.class)); - when(blockBlob.getBlobOutputStream()).thenReturn(mock(BlobOutputStream.class)); + when(blockBlob.getBlobOutputStream(true)).thenReturn(mock(BlobOutputStream.class)); when(blockBlob.getProperties()).thenReturn(blobProperties); when(blobProperties.getBlobSize()).thenReturn(CONTENT_LENGTH);