@Test
public void getIndexMappingsWithIOException() {

  String indexName = "test";
  ClusterService clusterService = mockClusterService(indexName, new IOException());
  ElasticsearchNodeClient client = new ElasticsearchNodeClient(clusterService, nodeClient);
  assertThrows(IllegalStateException.class, () -> client.getIndexMappings(indexName));
}