aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-main/src/test
diff options
context:
space:
mode:
authorLukasz Jarocki <lukasz.jarocki@sonarsource.com>2022-03-16 11:08:17 +0100
committersonartech <sonartech@sonarsource.com>2022-03-16 20:03:28 +0000
commit9b9654a8db9b8adf824fd35f09020578798baf52 (patch)
tree2c0923d7ae467b8ce6bca1b34dfc87ebfa665421 /server/sonar-main/src/test
parent54f223072f9ba3f8a1acb8dfb277f1423db2e0cd (diff)
downloadsonarqube-9b9654a8db9b8adf824fd35f09020578798baf52.tar.gz
sonarqube-9b9654a8db9b8adf824fd35f09020578798baf52.zip
NO-JIRA fixed EsKeyStoreCliTest to work on Windows
Diffstat (limited to 'server/sonar-main/src/test')
-rw-r--r--server/sonar-main/src/test/java/org/sonar/application/es/EsKeyStoreCliTest.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/server/sonar-main/src/test/java/org/sonar/application/es/EsKeyStoreCliTest.java b/server/sonar-main/src/test/java/org/sonar/application/es/EsKeyStoreCliTest.java
index 197d38d166c..089200e62b4 100644
--- a/server/sonar-main/src/test/java/org/sonar/application/es/EsKeyStoreCliTest.java
+++ b/server/sonar-main/src/test/java/org/sonar/application/es/EsKeyStoreCliTest.java
@@ -22,6 +22,7 @@ package org.sonar.application.es;
import java.io.File;
import java.io.InputStream;
import java.io.OutputStream;
+import java.nio.file.Paths;
import java.util.concurrent.TimeUnit;
import org.junit.Rule;
import org.junit.Test;
@@ -60,16 +61,20 @@ public class EsKeyStoreCliTest {
MockProcess process = (MockProcess) underTest.executeWith(EsKeyStoreCliTest::mockLaunch);
JavaCommand<?> executedCommand = process.getExecutedCommand();
+
+ String expectedHomeLibPath = Paths.get(homeDir.toString(), "lib") + "/*";
+ String expectedHomeKeystorePath = Paths.get(homeDir.toString(), "lib", "tools", "keystore-cli") + "/*";
+
assertThat(executedCommand.getClassName()).isEqualTo("org.elasticsearch.common.settings.KeyStoreCli");
assertThat(executedCommand.getClasspath())
- .containsExactly(homeDir.getAbsolutePath() + "/lib/*", homeDir.getAbsolutePath() + "/lib/tools/keystore-cli/*");
+ .containsExactly(expectedHomeLibPath, expectedHomeKeystorePath);
assertThat(executedCommand.getParameters()).containsExactly("add", "-x", "-f", "test.property1", "test.property2", "test.property3");
assertThat(executedCommand.getJvmOptions().getAll()).containsExactly(
"-Xshare:auto",
"-Xms4m",
"-Xmx64m",
- "-Des.path.home=" + homeDir.getAbsolutePath(),
- "-Des.path.conf=" + confDir.getAbsolutePath(),
+ "-Des.path.home=" + homeDir.toPath(),
+ "-Des.path.conf=" + confDir.toPath(),
"-Des.distribution=default",
"-Des.distribution.type=tar");