Commit b2f4a08209b4efecf645a51d11461ef2370ae45c
1 parent
d76b9eff
Added set default edge root rule chain test
Showing
1 changed file
with
15 additions
and
0 deletions
... | ... | @@ -332,6 +332,21 @@ public abstract class BaseRuleChainServiceTest extends AbstractServiceTest { |
332 | 332 | Assert.assertEquals(1, result.size()); |
333 | 333 | } |
334 | 334 | |
335 | + @Test | |
336 | + public void setDefaultRootEdgeRuleChain() throws Exception { | |
337 | + RuleChainId ruleChainId1 = saveRuleChainAndSetDefaultEdge("Default Edge Rule Chain 1"); | |
338 | + RuleChainId ruleChainId2 = saveRuleChainAndSetDefaultEdge("Default Edge Rule Chain 2"); | |
339 | + | |
340 | + ruleChainService.setDefaultRootEdgeRuleChain(tenantId, ruleChainId1); | |
341 | + ruleChainService.setDefaultRootEdgeRuleChain(tenantId, ruleChainId2); | |
342 | + | |
343 | + RuleChain ruleChainById = ruleChainService.findRuleChainById(tenantId, ruleChainId1); | |
344 | + Assert.assertFalse(ruleChainById.isRoot()); | |
345 | + | |
346 | + ruleChainById = ruleChainService.findRuleChainById(tenantId, ruleChainId2); | |
347 | + Assert.assertTrue(ruleChainById.isRoot()); | |
348 | + } | |
349 | + | |
335 | 350 | private RuleChainId saveRuleChainAndSetDefaultEdge(String name) { |
336 | 351 | RuleChain edgeRuleChain = new RuleChain(); |
337 | 352 | edgeRuleChain.setTenantId(tenantId); | ... | ... |