aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-engine/src
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2024-10-14 16:21:50 +0200
committersonartech <sonartech@sonarsource.com>2024-10-15 20:03:06 +0000
commitc6168aa2917eeef83c3383c7eddf35e84394b499 (patch)
tree9f5c28bde27f1e9efd1ceb231889daaf557ba14f /sonar-scanner-engine/src
parentb59bb3e380b864a5760ae7ae7bbf773d01273ebf (diff)
downloadsonarqube-c6168aa2917eeef83c3383c7eddf35e84394b499.tar.gz
sonarqube-c6168aa2917eeef83c3383c7eddf35e84394b499.zip
NO-JIRA Fix the Quality Gate
Diffstat (limited to 'sonar-scanner-engine/src')
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java2
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorValidatorTest.java6
-rw-r--r--sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java9
3 files changed, 8 insertions, 9 deletions
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
index 97d33f200fa..30472694f71 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/bootstrap/PluginFilesTest.java
@@ -276,7 +276,7 @@ class PluginFilesTest {
FileAndMd5() throws IOException {
this.file = Files.createTempFile(tempDir, "jar", null);
- Files.write(this.file, RandomStringUtils.random(3).getBytes());
+ Files.write(this.file, RandomStringUtils.secure().next(3).getBytes());
try (InputStream fis = Files.newInputStream(this.file)) {
this.md5 = DigestUtils.md5Hex(fis);
} catch (IOException e) {
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorValidatorTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorValidatorTest.java
index 3be0fda2132..40d785b4c51 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorValidatorTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scanner/scan/ProjectReactorValidatorTest.java
@@ -38,7 +38,7 @@ import org.sonar.scanner.ProjectInfo;
import org.sonar.scanner.bootstrap.GlobalConfiguration;
import static java.lang.String.format;
-import static org.apache.commons.lang3.RandomStringUtils.randomAscii;
+import static org.apache.commons.lang3.RandomStringUtils.secure;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.mock;
@@ -181,7 +181,7 @@ class ProjectReactorValidatorTest {
null,
"1.0",
"2017-10-16",
- randomAscii(100)
+ secure().nextAscii(100)
);
}
@@ -199,7 +199,7 @@ class ProjectReactorValidatorTest {
null,
"1.0",
"2017-10-16",
- randomAscii(100)
+ secure().nextAscii(100)
);
}
diff --git a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java
index 20ee5a69035..d6e7fef0d5e 100644
--- a/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java
+++ b/sonar-scanner-engine/src/test/java/org/sonar/scm/git/ChangedFileTest.java
@@ -26,7 +26,6 @@ import org.sonar.api.batch.fs.internal.DefaultIndexedFile;
import org.sonar.api.batch.fs.internal.DefaultInputFile;
import org.sonar.api.batch.fs.internal.SensorStrategy;
-import static org.apache.commons.lang3.RandomStringUtils.random;
import static org.apache.commons.lang3.RandomStringUtils.secure;
import static org.assertj.core.api.Assertions.assertThat;
@@ -82,11 +81,11 @@ public class ChangedFileTest {
private DefaultIndexedFile composeDefaultIndexFile(Path path, String oldRelativePath) {
return new DefaultIndexedFile(
path,
- random(5),
- random(5),
- random(5),
+ secure().next(5),
+ secure().next(5),
+ secure().next(5),
InputFile.Type.MAIN,
- random(5),
+ secure().next(5),
Integer.parseInt(secure().nextNumeric(5)),
new SensorStrategy(),
oldRelativePath);