ChinchuAjith commented on code in PR #6556:
URL:
https://github.com/apache/incubator-kie-drools/pull/6556#discussion_r2730473230
##########
kie-dmn/kie-dmn-core/src/test/java/org/kie/dmn/core/DMNDecisionTableRuntimeTest.java:
##########
@@ -208,18 +208,51 @@ void decisionTableNonexistingInputErrorMessage(boolean
useExecModelCompiler) {
context.set( "Not exists", "Province" );
context.set( "Number of Branches", BigDecimal.valueOf( 10 ) );
- testDecisionTableInvalidInput( context );
+ testDecisionTableMissingDependency( context );
}
- private void testDecisionTableInvalidInput(final DMNContext inputContext) {
+ private void testDecisionTableInvalidInputLenient(final DMNContext
inputContext) {
final DMNRuntime runtime = DMNRuntimeUtil.createRuntime(
"InvalidInput.dmn", this.getClass() );
final DMNModel dmnModel = runtime.getModel(
"http://www.trisotech.com/dmn/definitions/_cdf29af2-959b-4004-8271-82a9f5a62147",
"Dessin 1" );
assertThat(dmnModel).isNotNull();
final DMNResult dmnResult = runtime.evaluateAll( dmnModel,
inputContext );
+ // In lenient mode (default), invalid input values don't generate
errors
+ // The invalid value is set to null and evaluation continues
+ assertThat( dmnResult.hasErrors()).isFalse();
+
+ final DMNContext result = dmnResult.getContext();
+ // Result is defined - evaluation continues with null for invalid input
+ assertThat( result.isDefined( "Branches distribution"
)).isEqualTo(Boolean.TRUE);
+ }
Review Comment:
Test cases added for strict mode
--
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]