Restore model validation not to fail on diagnostic errors for rules and scripts (#5351)

* Restore model validation not to fail on diagnostic errors

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This commit is contained in:
jimtng
2026-02-14 13:28:52 +01:00
committed by GitHub
parent 50aea478ca
commit f9776bcb7f
2 changed files with 25 additions and 1 deletions
@@ -268,4 +268,26 @@ public class DSLRuleProviderTest extends JavaOSGiTest {
Object x = context.getValue(QualifiedName.create("x"));
assertThat(x, is(15));
}
@Test
public void testRuleWithUntypedLambdaArgsDoesNotFailToLoad() {
Collection<Rule> rules = dslRuleProvider.getAll();
assertThat(rules.size(), is(0));
String model = """
var lambdaWithUntypedArgs = [ foo | foo ]
rule "RuleWithUntypedLambdaArgs"
when
System started
then
logInfo('Test', 'Test')
end
""";
modelRepository.addOrRefreshModel(TESTMODEL_NAME,
new ByteArrayInputStream(model.getBytes(StandardCharsets.UTF_8)));
Collection<Rule> actualRules = dslRuleProvider.getAll();
assertThat(actualRules.size(), is(1));
}
}