}
@Test
public void search_by_template_key_with_params() throws InterruptedException {
RuleDto templateRule = RuleTesting.newDto(RuleKey.of("java", "S001")).setIsTemplate(true);
RuleParamDto ruleParamDto = RuleParamDto.createFor(templateRule).setName("regex").setType("STRING").setDescription("Reg ex").setDefaultValue(".*");
dao.insert(dbSession, templateRule);
dao.addRuleParam(dbSession, templateRule, ruleParamDto);
RuleDto customRule = RuleTesting.newDto(RuleKey.of("java", "S001_MY_CUSTOM")).setTemplateId(templateRule.getId());
RuleParamDto customRuleParam = RuleParamDto.createFor(customRule).setName("regex").setType("STRING").setDescription("Reg ex").setDefaultValue("a.*");
dao.insert(dbSession, customRule);
dao.addRuleParam(dbSession, customRule, customRuleParam);
dbSession.commit();
// find all