Skip to content

Commit 551a7d6

Browse files
authored
[TEST] Migrated ccs-unavailable-clusters QA tests (elastic#114764)
Ccs-unavailable-clusters QA tests migrated to the new REST testing framework, using 'elasticsearch.internal-java-rest-test' Gradle plugin
1 parent 44df062 commit 551a7d6

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

qa/ccs-unavailable-clusters/build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
* your election, the "Elastic License 2.0", the "GNU Affero General Public
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
9-
apply plugin: 'elasticsearch.legacy-java-rest-test'
109

11-
testClusters.matching { it.name == "javaRestTest" }.configureEach {
12-
setting 'xpack.security.enabled', 'true'
13-
user username: 'admin', password: 'admin-password', role: 'superuser'
10+
import org.elasticsearch.gradle.testclusters.StandaloneRestIntegTestTask
11+
12+
apply plugin: 'elasticsearch.internal-java-rest-test'
13+
14+
15+
tasks.withType(StandaloneRestIntegTestTask) {
16+
usesDefaultDistribution()
1417
}

qa/ccs-unavailable-clusters/src/javaRestTest/java/org/elasticsearch/search/CrossClusterSearchUnavailableClusterIT.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,15 @@
3838
import org.elasticsearch.common.util.concurrent.EsExecutors;
3939
import org.elasticsearch.common.util.concurrent.ThreadContext;
4040
import org.elasticsearch.search.aggregations.InternalAggregations;
41+
import org.elasticsearch.test.cluster.ElasticsearchCluster;
4142
import org.elasticsearch.test.rest.ESRestTestCase;
4243
import org.elasticsearch.test.rest.ObjectPath;
4344
import org.elasticsearch.test.transport.MockTransportService;
4445
import org.elasticsearch.threadpool.TestThreadPool;
4546
import org.elasticsearch.threadpool.ThreadPool;
4647
import org.elasticsearch.xcontent.XContentBuilder;
4748
import org.elasticsearch.xcontent.json.JsonXContent;
49+
import org.junit.ClassRule;
4850

4951
import java.io.IOException;
5052
import java.util.Collections;
@@ -61,6 +63,14 @@ public class CrossClusterSearchUnavailableClusterIT extends ESRestTestCase {
6163

6264
private final ThreadPool threadPool = new TestThreadPool(getClass().getName());
6365

66+
@ClassRule
67+
public static ElasticsearchCluster cluster = ElasticsearchCluster.local().build();
68+
69+
@Override
70+
protected String getTestRestCluster() {
71+
return cluster.getHttpAddresses();
72+
}
73+
6474
@Override
6575
public void tearDown() throws Exception {
6676
super.tearDown();

0 commit comments

Comments
 (0)