]> source.dussan.org Git - sonarqube.git/commitdiff
NO-JIRA fix code smell
authorAurelien Poscia <aurelien.poscia@sonarsource.com>
Thu, 11 May 2023 14:25:27 +0000 (16:25 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 11 May 2023 20:03:15 +0000 (20:03 +0000)
server/sonar-ce-common/src/it/java/org/sonar/ce/queue/CeQueueImplIT.java
server/sonar-db-dao/src/it/java/org/sonar/db/property/InternalPropertiesDaoIT.java

index d89b20a568bf9a463e3980f628e5ffabeb44ee2b..12195d1aac85f5a3428862208539fb9049ccb700 100644 (file)
@@ -315,7 +315,7 @@ public class CeQueueImplIT {
   public void massSubmit_with_UNIQUE_QUEUE_PER_MAIN_COMPONENT_does_not_create_task_when_there_is_many_pending_task_for_same_main_component() {
     String mainComponentUuid = randomAlphabetic(5);
     CeTaskSubmit taskSubmit = createTaskSubmit("with_component", newComponent(mainComponentUuid), null);
-    String[] uuids = IntStream.range(0, 2 + new Random().nextInt(5))
+    String[] uuids = IntStream.range(0, 7)
       .mapToObj(i -> insertPendingInQueue(newComponent(mainComponentUuid)))
       .map(CeQueueDto::getUuid)
       .toArray(String[]::new);
index 4e0876e1e3cb57cc98706030deeb5ebe07ba82ae..e606d7443006555311fd20137e03dd9f4ba664ed 100644 (file)
@@ -369,11 +369,10 @@ public class InternalPropertiesDaoIT {
 
   @Test
   public void selectByKeys_throws_IAE_when_keys_contains_null() {
-    Random random = new Random();
     Set<String> keysIncludingANull = Stream.of(
-      IntStream.range(0, random.nextInt(10)).mapToObj(i -> "b_" + i),
+      IntStream.range(0, 10).mapToObj(i -> "b_" + i),
       Stream.of((String) null),
-      IntStream.range(0, random.nextInt(10)).mapToObj(i -> "a_" + i))
+      IntStream.range(0, 10).mapToObj(i -> "a_" + i))
       .flatMap(s -> s)
       .collect(Collectors.toSet());