aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-main/src/test/java/org
diff options
context:
space:
mode:
authorPierre <pierre.guillot@sonarsource.com>2023-07-07 08:49:05 +0200
committersonartech <sonartech@sonarsource.com>2023-07-17 20:03:45 +0000
commitc62e96c1586baff4fcb6ffb71c2166686c6dbb68 (patch)
tree80c2e1c3e754d179833ebaad2db2c1cefb94db5c /server/sonar-main/src/test/java/org
parent470a55b6ae21f203d5f0fa27e4b7d114d3922902 (diff)
downloadsonarqube-c62e96c1586baff4fcb6ffb71c2166686c6dbb68.tar.gz
sonarqube-c62e96c1586baff4fcb6ffb71c2166686c6dbb68.zip
NO-JIRA replace Collectors.toList to Stream.toList
Diffstat (limited to 'server/sonar-main/src/test/java/org')
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/cluster/health/DelegateHealthStateRefresherExecutorServiceTest.java3
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/command/JvmOptionsTest.java3
2 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-main/src/test/java/org/sonar/application/cluster/health/DelegateHealthStateRefresherExecutorServiceTest.java b/server/sonar-main/src/test/java/org/sonar/application/cluster/health/DelegateHealthStateRefresherExecutorServiceTest.java
index d5d862139c4..e55fedce872 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/cluster/health/DelegateHealthStateRefresherExecutorServiceTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/cluster/health/DelegateHealthStateRefresherExecutorServiceTest.java
@@ -26,7 +26,6 @@ import java.util.concurrent.ExecutionException;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.junit.Test;
@@ -40,7 +39,7 @@ public class DelegateHealthStateRefresherExecutorServiceTest {
private Callable callable = mock(Callable.class);
private Collection<Callable<Object>> callables = IntStream.range(0, random.nextInt(5))
.mapToObj(i -> (Callable<Object>) mock(Callable.class))
- .collect(Collectors.toList());
+ .toList();
private int initialDelay = random.nextInt(333);
private int delay = random.nextInt(333);
private int period = random.nextInt(333);
diff --git a/server/sonar-main/src/test/java/org/sonar/application/command/JvmOptionsTest.java b/server/sonar-main/src/test/java/org/sonar/application/command/JvmOptionsTest.java
index 3c6b727efcb..fa733a62bac 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/command/JvmOptionsTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/command/JvmOptionsTest.java
@@ -23,6 +23,7 @@ import com.google.common.collect.ImmutableMap;
import com.tngtech.java.junit.dataprovider.DataProvider;
import com.tngtech.java.junit.dataprovider.DataProviderRunner;
import com.tngtech.java.junit.dataprovider.UseDataProvider;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -376,7 +377,7 @@ public class JvmOptionsTest {
}
private static Map<String, String> shuffleThenToMap(Stream<Option> stream) {
- List<Option> options = stream.collect(Collectors.toList());
+ List<Option> options = stream.collect(Collectors.toCollection(ArrayList::new));
Collections.shuffle(options);
Map<String, String> res = new HashMap<>(options.size());
for (Option option : options) {