@Test
void search() {

  when(searchAction.apply(any())).thenReturn(searchResponse);
  when(searchResponse.getHits()).thenReturn(searchHits);
  when(searchHits.getHits()).thenReturn(new SearchHit[] {searchHit});
  ElasticsearchResponse searchResponse = request.search(searchAction, scrollAction);
  assertFalse(searchResponse.isEmpty());
  searchResponse = request.search(searchAction, scrollAction);
  assertTrue(searchResponse.isEmpty());
  verify(searchAction, times(1)).apply(any());
}