[ 
https://issues.apache.org/jira/browse/HADOOP-18980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17817851#comment-17817851
 ] 

ASF GitHub Bot commented on HADOOP-18980:
-----------------------------------------

virajjasani commented on code in PR #6546:
URL: https://github.com/apache/hadoop/pull/6546#discussion_r1492011256


##########
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/util/TestStringUtils.java:
##########
@@ -566,6 +568,86 @@ public void testStringCollectionSplitByEquals() {
         .containsEntry("element.xyz.key5", "element.abc.val5")
         .containsEntry("element.xyz.key6", "element.abc.val6")
         .containsEntry("element.xyz.key7", "element.abc.val7");
+
+    try {
+      StringUtils.getTrimmedStringCollectionSplitByEquals(
+          " = element.abc.val1");
+      throw new RuntimeException("Expected to throw IllegalArgumentException");
+    } catch (IllegalArgumentException e) {
+      Assertions
+          .assertThat(e)
+          .describedAs("Exception thrown due to illegal arguments")
+          .hasMessageStartingWith(STRING_COLLECTION_SPLIT_EQUALS_INVALID_ARG);
+    }
+
+    splitMap = StringUtils.getTrimmedStringCollectionSplitByEquals(
+        "element.first.key1 = element.first.val2 ,element.first.key1 
=element.first.val1");
+    Assertions
+        .assertThat(splitMap)
+        .describedAs("Map of key value pairs split by equals(=) and comma(,)")
+        .hasSize(1)
+        .containsEntry("element.first.key1", "element.first.val1");
+
+    splitMap = StringUtils.getTrimmedStringCollectionSplitByEquals(
+        ",,, , ,, ,element.first.key1 = element.first.val2 ,"
+            + "element.first.key1 = element.first.val1 , ,,, ,");
+    Assertions
+        .assertThat(splitMap)
+        .describedAs("Map of key value pairs split by equals(=) and comma(,)")
+        .hasSize(1)
+        .containsEntry("element.first.key1", "element.first.val1");
+
+    try {
+      StringUtils.getTrimmedStringCollectionSplitByEquals(

Review Comment:
   ah yes, that's already an amazing utility





> S3A credential provider remapping: make extensible
> --------------------------------------------------
>
>                 Key: HADOOP-18980
>                 URL: https://issues.apache.org/jira/browse/HADOOP-18980
>             Project: Hadoop Common
>          Issue Type: Sub-task
>          Components: fs/s3
>    Affects Versions: 3.4.0
>            Reporter: Steve Loughran
>            Assignee: Viraj Jasani
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 3.4.0, 3.5.0, 3.4.1
>
>
> s3afs will now remap the common com.amazonaws credential providers to 
> equivalents in the v2 sdk or in hadoop-aws
> We could do the same for third party credential providers by taking a 
> key=value list in a configuration property and adding to the map. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: common-issues-h...@hadoop.apache.org

Reply via email to