essobedo commented on code in PR #8936:
URL: https://github.com/apache/camel/pull/8936#discussion_r1054267230


##########
components/camel-bean/src/test/java/org/apache/camel/component/bean/BeanInfoTest.java:
##########
@@ -108,6 +111,28 @@ public String myMethod() {
         assertTrue(info.hasAnyMethodHandlerAnnotation());
     }
 
+    @Test
+    public void testSplitSafeQuotesUnremoveQuoteAfterValidParameterTypeCheck() 
{
+        String[] out = 
StringQuoteHelper.splitSafeQuote("'Hello,Camel','Bye,World'", ',', true, true);
+        Iterator<?> it = ObjectHelper.createIterator(out, ",", true);
+        Object parameterValue = it != null && it.hasNext() ? it.next() : null;
+        while (parameterValue != null) {
+            
assertTrue(BeanHelper.isValidParameterValue(parameterValue.toString()));
+            parameterValue = it != null && it.hasNext() ? it.next() : null;
+        }
+    }
+
+    @Test
+    public void testSplitSafeQuoteRemoveQuoteAfterValidParameterTypeCheck() {
+        String[] out = 
StringQuoteHelper.splitSafeQuote("'\"Hello,Camel\"','\"Bye,World\"'", ',');
+        Iterator<?> it = ObjectHelper.createIterator(out, ",", true);
+        Object parameterValue = it != null && it.hasNext() ? it.next() : null;
+        while (parameterValue != null) {
+            
assertTrue(BeanHelper.isValidParameterValue(parameterValue.toString()));
+            parameterValue = it != null && it.hasNext() ? it.next() : null;
+        }
+    }

Review Comment:
   You will see in the different tests that it is already possible to get 
`'Hello'` with single quotes if you use double quotes in your expression like 
`"'Hello'"`. 



-- 
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.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to