static String computeDetailsAsString(SearchRequest searchRequest) {
    StringBuilder message = new StringBuilder();
    message.append(String.format("ES search request '%s'", searchRequest));
    if (searchRequest.indices().length > 0) {
      message.append(String.format(ON_INDICES_MESSAGE, Arrays.toString(searchRequest.indices())));
    }
    return message.toString();
  }
@Test
  public void should_format_ClusterHealthRequest() {
    ClusterHealthRequest request = new ClusterHealthRequest("index-1");

    assertThat(EsRequestDetails.computeDetailsAsString(request))
      .isEqualTo("ES cluster health request on indices 'index-1'");
  }