diff --git a/client/rest-high-level/src/test/java/org/elasticsearch/client/ESRestHighLevelClientTestCase.java b/client/rest-high-level/src/test/java/org/elasticsearch/client/ESRestHighLevelClientTestCase.java index 9217b0b4e55..07c0d818bfa 100644 --- a/client/rest-high-level/src/test/java/org/elasticsearch/client/ESRestHighLevelClientTestCase.java +++ b/client/rest-high-level/src/test/java/org/elasticsearch/client/ESRestHighLevelClientTestCase.java @@ -28,6 +28,7 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentType; +import org.elasticsearch.core.internal.io.IOUtils; import org.elasticsearch.ingest.Pipeline; import org.elasticsearch.test.rest.ESRestTestCase; import org.junit.AfterClass; @@ -53,7 +54,7 @@ public abstract class ESRestHighLevelClientTestCase extends ESRestTestCase { @AfterClass public static void cleanupClient() throws IOException { - restHighLevelClient.close(); + IOUtils.close(restHighLevelClient); restHighLevelClient = null; }