yesamer commented on code in PR #6538:
URL:
https://github.com/apache/incubator-kie-drools/pull/6538#discussion_r2589515632
##########
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/",
Review Comment:
@AthiraHari77 I would suggest to directly import
SimpleTypeImpl.UNKNOWN_DMNTYPE.
--
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]