eliminate NPE on closing restHighLevelClient (if test suite skips all test cases)
(cherry picked from 277704c5972148ee62900e781ac64b061aa4b767)
This commit is contained in:
parent
e41c5cb47a
commit
3621277969
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue