@Test
void cleanupWithIOException() throws IOException {

  when(restClient.clearScroll(any(), any())).thenThrow(new IOException());
  ElasticsearchScrollRequest request = new ElasticsearchScrollRequest("test", factory);
  request.setScrollId("scroll123");
  assertThrows(IllegalStateException.class, () -> client.cleanup(request));
}