diff --git a/sdk/storage/azure-storage-file-share/assets.json b/sdk/storage/azure-storage-file-share/assets.json index fb4cf77a3e2da..fe478573e605e 100644 --- a/sdk/storage/azure-storage-file-share/assets.json +++ b/sdk/storage/azure-storage-file-share/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/storage/azure-storage-file-share", - "Tag": "java/storage/azure-storage-file-share_47012b0179" + "Tag": "java/storage/azure-storage-file-share_f461f13849" } diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java index a77fb47129c13..4a9a58e0cd8b0 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java @@ -125,6 +125,25 @@ public void getFileClient() { assertInstanceOf(ShareFileClient.class, fileClient); } + private static Stream getNonEncodedFileNameSupplier() { + return Stream.of( + Arguments.of("test%test"), + Arguments.of("%Россия 한국 中国!"), + Arguments.of("%E6%96%91%E9%BB%9E"), + Arguments.of("斑點") + ); + } + + @ParameterizedTest + @MethodSource("getNonEncodedFileNameSupplier") + public void getNonEncodedFileName(String fileName) { + primaryDirectoryClient.create(); + ShareFileClient fileClient = primaryDirectoryClient.getFileClient(fileName); + assertEquals(primaryDirectoryClient.getDirectoryPath() + "/" + fileName, fileClient.getFilePath()); + fileClient.create(1024); + assertTrue(fileClient.exists()); + } + @Test public void exists() { primaryDirectoryClient.create(); diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java index 523b51d3fbe4b..5d3ff2fcc7983 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileApiTests.java @@ -2708,6 +2708,24 @@ public void getFilePath() { assertEquals(filePath, primaryFileClient.getFilePath()); } + private static Stream getNonEncodedFileNameSupplier() { + return Stream.of( + Arguments.of("test%test"), + Arguments.of("%Россия 한국 中国!"), + Arguments.of("%E6%96%91%E9%BB%9E"), + Arguments.of("斑點") + ); + } + + @ParameterizedTest + @MethodSource("getNonEncodedFileNameSupplier") + public void getNonEncodedFileName(String fileName) { + ShareFileClient fileClient = shareClient.getFileClient(fileName); + assertEquals(fileName, fileClient.getFilePath()); + fileClient.create(1024); + assertTrue(fileClient.exists()); + } + // This tests the policy is in the right place because if it were added per retry, it would be after the credentials // and auth would fail because we changed a signed header. public void perCallPolicy() {