sergehuber commented on code in PR #715:
URL: https://github.com/apache/unomi/pull/715#discussion_r2428298779
##########
itests/src/test/java/org/apache/unomi/itests/RuleServiceIT.java:
##########
@@ -80,16 +80,27 @@ public void testRuleWithNullActions() throws
InterruptedException {
public void getAllRulesShouldReturnAllRulesAvailable() throws
InterruptedException {
String ruleIDBase = "moreThan50RuleTest";
int originalRulesNumber = rulesService.getAllRules().size();
+
+ // Create a simple condition instead of null
+ Condition defaultCondition = new
Condition(definitionsService.getConditionType("matchAllCondition"));
+
+ // Create a default action
+ Action defaultAction = new
Action(definitionsService.getActionType("setPropertyAction"));
+ defaultAction.setParameter("propertyName", "testProperty");
+ defaultAction.setParameter("propertyValue", "testValue");
+ List<Action> actions = Collections.singletonList(defaultAction);
+
+
for (int i = 0; i < 60; i++) {
String ruleID = ruleIDBase + "_" + i;
Metadata metadata = new Metadata(ruleID);
metadata.setName(ruleID);
metadata.setDescription(ruleID);
metadata.setScope(TEST_SCOPE);
- Rule nullRule = new Rule(metadata);
- nullRule.setCondition(null);
- nullRule.setActions(null);
- createAndWaitForRule(nullRule);
+ Rule rule = new Rule(metadata);
+ rule.setCondition(defaultCondition); // Use default condition
instead of null
+ rule.setActions(actions); // Empty list instead of null
Review Comment:
Fixed
--
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]