ChinchuAjith commented on code in PR #6299:
URL: 
https://github.com/apache/incubator-kie-drools/pull/6299#discussion_r2048300349


##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/util/NumberEvalHelperTest.java:
##########
@@ -34,4 +36,53 @@ void getBigDecimalOrNull() {
         
assertThat(NumberEvalHelper.getBigDecimalOrNull(10000000000.5D)).isEqualTo(new 
BigDecimal("10000000000.5"));
     }
 
+    @Test
+    void coerceIntegerNumber_withBigDecimal() {
+        //Verifies that BigDecimal values are truncated (not rounded) when 
coerced to integers.
+        Optional<Integer> result = NumberEvalHelper.coerceIntegerNumber(new 
BigDecimal("99.99"));
+        assertThat(result).isPresent();
+        assertThat(result.get()).isEqualTo(99);
+    }
+
+    @Test
+    void coerceIntegerNumber_withBigInteger() {
+        Optional<Integer> result = NumberEvalHelper.coerceIntegerNumber(new 
BigInteger("1000"));
+        assertThat(result).isPresent();
+        assertThat(result.get()).isEqualTo(1000);
+    }
+
+    @Test
+    void coerceIntegerNumber_withDouble() {

Review Comment:
   test cases added



##########
kie-dmn/kie-dmn-feel/src/test/java/org/kie/dmn/feel/util/NumberEvalHelperTest.java:
##########
@@ -34,4 +36,53 @@ void getBigDecimalOrNull() {
         
assertThat(NumberEvalHelper.getBigDecimalOrNull(10000000000.5D)).isEqualTo(new 
BigDecimal("10000000000.5"));
     }
 
+    @Test
+    void coerceIntegerNumber_withBigDecimal() {
+        //Verifies that BigDecimal values are truncated (not rounded) when 
coerced to integers.
+        Optional<Integer> result = NumberEvalHelper.coerceIntegerNumber(new 
BigDecimal("99.99"));

Review Comment:
   test cases added



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