diff --git a/build.gradle b/build.gradle index 40819857..33e81ff2 100644 --- a/build.gradle +++ b/build.gradle @@ -450,6 +450,7 @@ int endJmxPort = startJmxPort integTest { useCluster testClusters.leaderCluster useCluster testClusters.followCluster + systemProperty "password", "admin" // setting it to `admin` explicitly since its a custom security setup if(knnEnabled){ nonInputProperties.systemProperty('tests.knn_plugin_enabled', "true") diff --git a/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt b/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt index 84b73b85..185cadc4 100644 --- a/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/replication/MultiClusterRestTestCase.kt @@ -236,9 +236,9 @@ abstract class MultiClusterRestTestCase : OpenSearchTestCase() { defaultHeaders[i++] = BasicHeader(key, value) } - val creds = System.getProperty("user", "admin") + System.getProperty("password", "myStrongPassword123!"); + val creds = System.getProperty("user", "admin") + ":" + System.getProperty("password", "myStrongPassword123!") if(securityEnabled) { - defaultHeaders[i++] = BasicHeader("Authorization", "Basic " + Base64.getUrlEncoder().encodeToString(creds.toByteArray(StandardCharsets.UTF_8))) + defaultHeaders[i++] = BasicHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString(creds.toByteArray(StandardCharsets.UTF_8))) } builder.setDefaultHeaders(defaultHeaders)