diff options
Diffstat (limited to 'server/sonar-db-dao')
-rw-r--r-- | server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDbTester.java | 4 | ||||
-rw-r--r-- | server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleTesting.java | 3 |
2 files changed, 3 insertions, 4 deletions
diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDbTester.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDbTester.java index 0b6c234cdd7..7ba24919da6 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDbTester.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleDbTester.java @@ -21,12 +21,12 @@ package org.sonar.db.rule; import java.util.Arrays; import java.util.function.Consumer; -import org.apache.commons.lang.RandomStringUtils; import org.sonar.api.rule.RuleKey; import org.sonar.api.server.rule.RuleParamType; import org.sonar.db.DbTester; import org.sonar.db.organization.OrganizationDto; +import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic; import static org.sonar.db.rule.RuleTesting.newRule; import static org.sonar.db.rule.RuleTesting.newRuleDto; @@ -125,7 +125,7 @@ public class RuleDbTester { public RuleParamDto insertRuleParam(RuleDto rule) { RuleParamDto param = new RuleParamDto(); param.setRuleId(rule.getId()); - param.setName(RandomStringUtils.random(10)); + param.setName(randomAlphabetic(10)); param.setType(RuleParamType.STRING.type()); db.getDbClient().ruleDao().insertRuleParam(db.getSession(), rule.getDefinition(), param); db.commit(); diff --git a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleTesting.java b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleTesting.java index 86c659636b8..696644b8705 100644 --- a/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleTesting.java +++ b/server/sonar-db-dao/src/test/java/org/sonar/db/rule/RuleTesting.java @@ -35,7 +35,6 @@ import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.collect.ImmutableSet.copyOf; import static com.google.common.collect.Sets.newHashSet; import static java.util.Objects.requireNonNull; -import static org.apache.commons.lang.RandomStringUtils.random; import static org.apache.commons.lang.RandomStringUtils.randomAlphabetic; import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric; import static org.apache.commons.lang.math.RandomUtils.nextInt; @@ -252,7 +251,7 @@ public class RuleTesting { } public static RuleKey randomRuleKeyOfMaximumLength() { - return RuleKey.of(random(255), random(200)); + return RuleKey.of(randomAlphabetic(255), randomAlphabetic(200)); } public static Consumer<RuleDefinitionDto> setRepositoryKey(String repositoryKey) { |