public RuleInformation createCustomRule(NewCustomRule newCustomRule) {
    try (DbSession dbSession = dbClient.openSession(false)) {
      return createCustomRule(newCustomRule, dbSession);
    }
  }
@Test
  public void createCustomRule_shouldReturnExceptedRuleInformation() {
    when(ruleCreator.create(Mockito.any(), Mockito.any(NewCustomRule.class))).thenReturn(new RuleDto().setUuid("uuid"));
    when(dbClient.ruleDao().selectRuleParamsByRuleUuids(any(), eq(List.of("uuid")))).thenReturn(List.of(new RuleParamDto().setUuid("paramUuid")));
    RuleInformation customRule = ruleService.createCustomRule(NewCustomRule.createForCustomRule(RuleKey.of("rep", "key"), RuleKey.of("rep", "custom")));
    assertThat(customRule.ruleDto().getUuid()).isEqualTo("uuid");
    assertThat(customRule.params()).extracting(RuleParamDto::getUuid).containsExactly("paramUuid");

    customRule = ruleService.createCustomRule(NewCustomRule.createForCustomRule(RuleKey.of("rep", "key"), RuleKey.of("rep", "custom")), mock(DbSession.class));
    assertThat(customRule.ruleDto().getUuid()).isEqualTo("uuid");
    assertThat(customRule.params()).extracting(RuleParamDto::getUuid).containsExactly("paramUuid");
  }