Skip to content

Commit a165390

Browse files
zhoufenqinunknown
andauthored
azure storage support overwrite blob resource (Azure#13859)
Co-authored-by: unknown <[email protected]>
1 parent 8b28942 commit a165390

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sdk/spring/azure-spring-cloud-storage/src/main/java/com/microsoft/azure/spring/cloud/storage/BlobStorageResource.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public OutputStream getOutputStream() throws IOException {
6161
throw new FileNotFoundException("The blob was not found: " + this.location);
6262
}
6363
}
64-
return this.blockBlobClient.getBlobOutputStream();
64+
return this.blockBlobClient.getBlobOutputStream(true);
6565
} catch (BlobStorageException e) {
6666
LOG.error(MSG_FAIL_OPEN_OUTPUT, e);
6767
throw new IOException(MSG_FAIL_OPEN_OUTPUT, e);

sdk/spring/azure-spring-cloud-storage/src/test/java/com/microsoft/azure/spring/cloud/storage/AzureBlobStorageTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public static BlobServiceClientBuilder mockBlobServiceClientBuilder() {
162162
when(nonExistingBlockBlob.getBlobName()).thenReturn(NON_EXISTING);
163163

164164
when(blockBlob.openInputStream()).thenReturn(mock(BlobInputStream.class));
165-
when(blockBlob.getBlobOutputStream()).thenReturn(mock(BlobOutputStream.class));
165+
when(blockBlob.getBlobOutputStream(true)).thenReturn(mock(BlobOutputStream.class));
166166

167167
when(blockBlob.getProperties()).thenReturn(blobProperties);
168168
when(blobProperties.getBlobSize()).thenReturn(CONTENT_LENGTH);

0 commit comments

Comments
 (0)