diff options
Diffstat (limited to 'server/sonar-main')
-rw-r--r-- | server/sonar-main/src/main/java/org/sonar/application/es/EsInstallation.java | 9 | ||||
-rw-r--r-- | server/sonar-main/src/test/java/org/sonar/application/es/EsInstallationTest.java | 6 |
2 files changed, 9 insertions, 6 deletions
diff --git a/server/sonar-main/src/main/java/org/sonar/application/es/EsInstallation.java b/server/sonar-main/src/main/java/org/sonar/application/es/EsInstallation.java index 6926c1054ad..6d084d23cba 100644 --- a/server/sonar-main/src/main/java/org/sonar/application/es/EsInstallation.java +++ b/server/sonar-main/src/main/java/org/sonar/application/es/EsInstallation.java @@ -20,11 +20,12 @@ package org.sonar.application.es; import java.io.File; -import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Properties; +import java.util.stream.Stream; import org.sonar.application.command.EsJvmOptions; +import org.sonar.core.util.stream.MoreCollectors; import org.sonar.process.Props; import static org.sonar.process.ProcessProperties.Property.PATH_DATA; @@ -65,12 +66,14 @@ public class EsInstallation { private static List<File> buildOutdatedSearchDirs(Props props) { String dataPath = props.nonNullValue(PATH_DATA.getKey()); - return Arrays.asList(new File(dataPath, "es"), new File(dataPath, "es5")); + return Stream.of("es", "es5", "es6") + .map(t -> new File(dataPath, t)) + .collect(MoreCollectors.toList()); } private static File buildDataDir(Props props) { String dataPath = props.nonNullValue(PATH_DATA.getKey()); - return new File(dataPath, "es6"); + return new File(dataPath, "es7"); } private static File buildLogPath(Props props) { diff --git a/server/sonar-main/src/test/java/org/sonar/application/es/EsInstallationTest.java b/server/sonar-main/src/test/java/org/sonar/application/es/EsInstallationTest.java index 445fce74baf..b2e70b77b29 100644 --- a/server/sonar-main/src/test/java/org/sonar/application/es/EsInstallationTest.java +++ b/server/sonar-main/src/test/java/org/sonar/application/es/EsInstallationTest.java @@ -102,7 +102,7 @@ public class EsInstallationTest { EsInstallation underTest = new EsInstallation(props); - assertThat(underTest.getDataDirectory()).isEqualTo(new File(dataDir, "es6")); + assertThat(underTest.getDataDirectory()).isEqualTo(new File(dataDir, "es7")); } @Test @@ -133,8 +133,8 @@ public class EsInstallationTest { EsInstallation underTest = new EsInstallation(props); assertThat(underTest.getOutdatedSearchDirectories()) - .extracting(t -> t.getName()) - .containsOnly("es", "es5"); + .extracting(File::getName) + .containsExactlyInAnyOrder("es", "es5", "es6"); } @Test |