ayushtkn commented on a change in pull request #2480:
URL: https://github.com/apache/hadoop/pull/2480#discussion_r528079002



##########
File path: 
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azure/MockStorageInterface.java
##########
@@ -137,9 +139,19 @@ private static String convertUriToDecodedString(URI uri) {
 
   private static URI convertKeyToEncodedUri(String key) {
     try {
-      return new URIBuilder().setPath(key).build();
+      URI unEncodedURI = new URI(key);
+      return new URIBuilder().setPath(unEncodedURI.getRawPath())
+          .setScheme(unEncodedURI.getScheme()).build();

Review comment:
       Seems only one test is failing, We can first convert the `key` to `Path` 
and then use `getPath` instead of `getRawPath` in `URIBuilder`. Something like 
this worked for me -
    ```suggestion
         Path p = new Path(key);
         URI unEncodedURI = p.toUri();
         return new URIBuilder().setPath(unEncodedURI.getPath())
             .setScheme(unEncodedURI.getScheme()).build();
   ```
   Give a try, if this works, if everything comes out to be safe post your 
testing.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to