RestElasticClient implements ElasticClient { @Override public void clearScroll(Set<String> scrollIds) throws IOException { final String path = "/_search/scroll"; if (!scrollIds.isEmpty()) { final Map<String,Object> requestBody = new HashMap<>(); requestBody.put("scroll_id", scrollIds); performRequest("DELETE", path, requestBody); } } RestElasticClient(RestClient client);  RestElasticClient(RestClient client, RestClient proxyClient, boolean enableRunAs); @Override double getVersion(); @Override List<String> getTypes(String indexName); @Override Map<String, Object> getMapping(String indexName, String type); @Override ElasticResponse search(String searchIndices, String type, ElasticRequest request); @Override ElasticResponse scroll(String scrollId, Integer scrollTime); @Override void clearScroll(Set<String> scrollIds); @Override void close(); @SuppressWarnings("unchecked") static void removeMapping(String parent, String key, Map<String,Object> data, String currentParent);  }
@Test public void testClearScroll() throws IOException { final RequestMatcher matcher = new RequestMatcher("DELETE", "/_search/scroll", "{\"scroll_id\":[\"id1\"]}", null); when(mockRestClient.performRequest(argThat(matcher))).thenReturn(mockResponse); client.clearScroll(ImmutableSet.of("id1")); }