gitgabrio commented on code in PR #6538:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6538#discussion_r2588682349


##########
kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/util/CoerceUtilTest.java:
##########
@@ -167,6 +167,39 @@ void actualCoerceValueCollectionToArray() {
         assertThat(retrieved).isEqualTo(item);
     }
 
+    @Test
+    void testCoerceValueToCollection() {
+        Object item = "TESTED_OBJECT";
+        Object value = Collections.singletonList(item);
+        DMNType requiredType = new 
SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/";,
+                "string",
+                null,
+                true,
+                null,
+                null,
+                null,
+                BuiltInType.STRING);
+        Object retrieved = CoerceUtil.actualCoerceValue(requiredType, item);
+        assertThat(retrieved).isNotNull();
+        assertThat(retrieved).isEqualTo(value);
+    }
+
+    @Test
+    void testCoerceValueToCollectionTypeAny() {
+        Object item = "TESTED_OBJECT";
+        DMNType requiredType = new 
SimpleTypeImpl("http://www.omg.org/spec/DMN/20180521/FEEL/";,
+                "Any",
+                null,
+                true,
+                null,
+                null,
+                null,
+                BuiltInType.UNKNOWN);
+        Object retrieved = CoerceUtil.actualCoerceValue(requiredType, item);
+        assertThat(retrieved).isNotNull();
+        assertThat(retrieved).isEqualTo(item);

Review Comment:
   Hi @AthiraHari77 
   If the `requiredType` is a collection (as in this case), should not the 
retrieved object be a collection too ? 🤔 



-- 
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: [email protected]

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