@Test
public void fetchDetailsWithElasticsearchException() {

  when(elasticsearchException.getDetailedMessage()).thenReturn("detail error");
  ElasticsearchErrorMessage errorMessage =
      new ElasticsearchErrorMessage(elasticsearchException, SERVICE_UNAVAILABLE.getStatus());
  assertEquals("detail error\n"
          + "For more details, please send request for "
          + "Json format to see the raw response from elasticsearch engine.",
      errorMessage.fetchDetails());
}