|
14 | 14 | import org.prebid.server.hooks.modules.rule.engine.core.config.model.SchemaFunctionConfig; |
15 | 15 | import org.prebid.server.hooks.modules.rule.engine.core.rules.AlternativeActionRule; |
16 | 16 | import org.prebid.server.hooks.modules.rule.engine.core.rules.CompositeRule; |
17 | | -import org.prebid.server.hooks.modules.rule.engine.core.rules.DefaultActionRule; |
18 | 17 | import org.prebid.server.hooks.modules.rule.engine.core.rules.ConditionalRuleFactory; |
| 18 | +import org.prebid.server.hooks.modules.rule.engine.core.rules.DefaultActionRule; |
19 | 19 | import org.prebid.server.hooks.modules.rule.engine.core.rules.NoOpRule; |
20 | 20 | import org.prebid.server.hooks.modules.rule.engine.core.rules.RandomWeightedRule; |
21 | 21 | import org.prebid.server.hooks.modules.rule.engine.core.rules.Rule; |
@@ -126,8 +126,9 @@ public void parseShouldCombineModelGroupRulesUnderSameRuleSetIntoRandomWeightedR |
126 | 126 | // when and then |
127 | 127 | final RandomWeightedRule<Object, Object> weightedRule = RandomWeightedRule.of( |
128 | 128 | randomGenerator, |
129 | | - new WeightedList<>( |
130 | | - List.of(WeightedEntry.of(1, matchingRule), WeightedEntry.of(2, matchingRule)))); |
| 129 | + new WeightedList<>(List.of( |
| 130 | + WeightedEntry.of(1, AlternativeActionRule.of(matchingRule, NoOpRule.create())), |
| 131 | + WeightedEntry.of(2, AlternativeActionRule.of(matchingRule, NoOpRule.create()))))); |
131 | 132 |
|
132 | 133 | assertThat(target.parse(accountConfig)).isEqualTo( |
133 | 134 | CompositeRule.of(Collections.singletonList(weightedRule))); |
@@ -196,8 +197,10 @@ public void parseShouldBuildRuleTreeAndCreateAppropriateMatchingRule() { |
196 | 197 | final AccountConfig accountConfig = givenAccountConfig(modelGroupConfig); |
197 | 198 |
|
198 | 199 | // when and then |
| 200 | + final AlternativeActionRule<Object, Object> alternativeRule = AlternativeActionRule.of( |
| 201 | + matchingRule, NoOpRule.create()); |
199 | 202 | final RandomWeightedRule<Object, Object> weightedRule = RandomWeightedRule.of( |
200 | | - randomGenerator, new WeightedList<>(List.of(WeightedEntry.of(1, matchingRule)))); |
| 203 | + randomGenerator, new WeightedList<>(List.of(WeightedEntry.of(1, alternativeRule)))); |
201 | 204 |
|
202 | 205 | assertThat(target.parse(accountConfig)).isEqualTo( |
203 | 206 | CompositeRule.of(Collections.singletonList(weightedRule))); |
|
0 commit comments