use of org.thingsboard.server.common.data.rule.RuleChain in project thingsboard by thingsboard.
the class BaseRuleChainServiceTest method setEdgeTemplateRootRuleChain.
@Test
public void setEdgeTemplateRootRuleChain() throws Exception {
RuleChainId ruleChainId1 = saveRuleChainAndSetAutoAssignToEdge("Default Edge Rule Chain 1");
RuleChainId ruleChainId2 = saveRuleChainAndSetAutoAssignToEdge("Default Edge Rule Chain 2");
ruleChainService.setEdgeTemplateRootRuleChain(tenantId, ruleChainId1);
ruleChainService.setEdgeTemplateRootRuleChain(tenantId, ruleChainId2);
RuleChain ruleChainById = ruleChainService.findRuleChainById(tenantId, ruleChainId1);
Assert.assertFalse(ruleChainById.isRoot());
ruleChainById = ruleChainService.findRuleChainById(tenantId, ruleChainId2);
Assert.assertTrue(ruleChainById.isRoot());
}
use of org.thingsboard.server.common.data.rule.RuleChain in project thingsboard by thingsboard.
the class BaseRuleChainServiceTest method testSaveRuleChainWithInvalidTenant.
@Test(expected = DataValidationException.class)
public void testSaveRuleChainWithInvalidTenant() {
RuleChain ruleChain = new RuleChain();
ruleChain.setName("My RuleChain");
ruleChain.setTenantId(TenantId.fromUUID(Uuids.timeBased()));
ruleChainService.saveRuleChain(ruleChain);
}
Aggregations