From 37faddcafa6a4acd707abea2525a71c25dc200f5 Mon Sep 17 00:00:00 2001 From: Luca Cavanna Date: Thu, 16 Jan 2014 21:59:37 +0100 Subject: [PATCH] [TEST] Wipe templates is now done in a single call using wildcards (compared to cluster state + delete each template) --- .../test/rest/junit/RestTestSuiteRunner.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java b/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java index f375973f289..21489e72705 100644 --- a/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java +++ b/src/test/java/org/elasticsearch/test/rest/junit/RestTestSuiteRunner.java @@ -60,7 +60,6 @@ import static org.elasticsearch.test.TestCluster.SHARED_CLUSTER_SEED; import static org.elasticsearch.test.TestCluster.clusterName; import static org.elasticsearch.test.rest.junit.DescriptionHelper.*; import static org.hamcrest.Matchers.equalTo; -import static org.hamcrest.Matchers.instanceOf; import static org.junit.Assert.assertThat; /** @@ -537,17 +536,8 @@ public class RestTestSuiteRunner extends ParentRunner { @SuppressWarnings("unchecked") public void wipeTemplates() throws IOException, RestException { logger.debug("deleting all templates"); - //delete templates by wildcard was only added in 0.90.6 - //httpResponse = restTestExecutionContext.callApi("indices.delete_template", "name", "*"); - RestResponse restResponse = restTestExecutionContext.callApiInternal("cluster.state", "metric", "metadata"); + RestResponse restResponse = restTestExecutionContext.callApiInternal("indices.delete_template", "name", "*"); assertThat(restResponse.getStatusCode(), equalTo(200)); - Object object = restResponse.evaluate("metadata.templates"); - assertThat(object, instanceOf(Map.class)); - Set templates = ((Map) object).keySet(); - for (String template : templates) { - restResponse = restTestExecutionContext.callApiInternal("indices.delete_template", "name", template); - assertThat(restResponse.getStatusCode(), equalTo(200)); - } } private void stopTestCluster() {