aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-pushapi
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2024-03-08 18:08:49 +0100
committersonartech <sonartech@sonarsource.com>2024-03-16 20:02:46 +0000
commit4592d635902de23b402a28787a8468ba1ac3a3a4 (patch)
tree2561ce21fbcd2fb14f77daa1e28f32b815291f1e /server/sonar-webserver-pushapi
parent4f2cb04c5da8b5b07c459afdb6d777b29db779b5 (diff)
downloadsonarqube-4592d635902de23b402a28787a8468ba1ac3a3a4.tar.gz
sonarqube-4592d635902de23b402a28787a8468ba1ac3a3a4.zip
SONAR-21452 move from commons-lang:commons-lang to org.apache.commons:commons-lang3
Diffstat (limited to 'server/sonar-webserver-pushapi')
-rw-r--r--server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java2
-rw-r--r--server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImplTest.java9
2 files changed, 7 insertions, 4 deletions
diff --git a/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java b/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java
index bcde07c91ce..baf693c63be 100644
--- a/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java
+++ b/server/sonar-webserver-pushapi/src/main/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImpl.java
@@ -33,7 +33,7 @@ import java.util.function.Predicate;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.Nullable;
-import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.sonar.api.rule.RuleKey;
import org.sonar.api.server.ServerSide;
diff --git a/server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImplTest.java b/server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImplTest.java
index db00b3846d8..cea9b9855cb 100644
--- a/server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImplTest.java
+++ b/server/sonar-webserver-pushapi/src/test/java/org/sonar/server/pushapi/qualityprofile/QualityProfileChangeEventServiceImplTest.java
@@ -20,10 +20,12 @@
package org.sonar.server.pushapi.qualityprofile;
import java.nio.charset.StandardCharsets;
+import java.security.SecureRandom;
import java.util.Collection;
import java.util.Collections;
import java.util.Deque;
import java.util.List;
+import java.util.Random;
import java.util.Set;
import java.util.function.Consumer;
import org.junit.Rule;
@@ -46,8 +48,7 @@ import org.sonar.server.qualityprofile.ActiveRuleChange;
import org.sonarqube.ws.Common;
import static java.util.List.of;
-import static org.apache.commons.lang.RandomStringUtils.randomAlphanumeric;
-import static org.apache.commons.lang.math.RandomUtils.nextInt;
+import static org.apache.commons.lang3.RandomStringUtils.randomAlphanumeric;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.api.measures.CoreMetrics.NCLOC_LANGUAGE_DISTRIBUTION_KEY;
import static org.sonar.api.measures.Metric.ValueType.STRING;
@@ -57,6 +58,8 @@ import static org.sonar.server.qualityprofile.ActiveRuleChange.Type.ACTIVATED;
public class QualityProfileChangeEventServiceImplTest {
+ private final Random random = new SecureRandom();
+
@Rule
public DbTester db = DbTester.create();
@@ -226,7 +229,7 @@ public class QualityProfileChangeEventServiceImplTest {
.setMetricUuid(metric.getUuid())
.setComponentUuid(branch.uuid())
.setProjectUuid(projectDto.getUuid())
- .setData(language + "=" + nextInt(10));
+ .setData(language + "=" + random.nextInt(10));
db.measures().insertLiveMeasure(branch, metric, configureLiveMeasure);
}