eliminate NPE on closing restHighLevelClient (if test suite skips all test cases)

(cherry picked from 277704c5972148ee62900e781ac64b061aa4b767)
This commit is contained in:
Vladimir Dolzhenko 2018-10-17 17:43:26 +02:00
parent e41c5cb47a
commit 3621277969
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}