@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()); }
@Override protected String fetchDetails() { StringBuilder details = new StringBuilder(); if (exception instanceof SearchPhaseExecutionException) { details.append( fetchSearchPhaseExecutionExceptionDetails((SearchPhaseExecutionException) exception)); } else { details.append(((ElasticsearchException) exception).getDetailedMessage()); } details.append( "\nFor more details, please send request for Json format to see the raw response from " + "elasticsearch engine."); return details.toString(); }
ElasticsearchErrorMessage extends ErrorMessage { @Override protected String fetchDetails() { StringBuilder details = new StringBuilder(); if (exception instanceof SearchPhaseExecutionException) { details.append( fetchSearchPhaseExecutionExceptionDetails((SearchPhaseExecutionException) exception)); } else { details.append(((ElasticsearchException) exception).getDetailedMessage()); } details.append( "\nFor more details, please send request for Json format to see the raw response from " + "elasticsearch engine."); return details.toString(); } }
ElasticsearchErrorMessage extends ErrorMessage { @Override protected String fetchDetails() { StringBuilder details = new StringBuilder(); if (exception instanceof SearchPhaseExecutionException) { details.append( fetchSearchPhaseExecutionExceptionDetails((SearchPhaseExecutionException) exception)); } else { details.append(((ElasticsearchException) exception).getDetailedMessage()); } details.append( "\nFor more details, please send request for Json format to see the raw response from " + "elasticsearch engine."); return details.toString(); } ElasticsearchErrorMessage(ElasticsearchException exception, int status); }
ElasticsearchErrorMessage extends ErrorMessage { @Override protected String fetchDetails() { StringBuilder details = new StringBuilder(); if (exception instanceof SearchPhaseExecutionException) { details.append( fetchSearchPhaseExecutionExceptionDetails((SearchPhaseExecutionException) exception)); } else { details.append(((ElasticsearchException) exception).getDetailedMessage()); } details.append( "\nFor more details, please send request for Json format to see the raw response from " + "elasticsearch engine."); return details.toString(); } ElasticsearchErrorMessage(ElasticsearchException exception, int status);  }
ElasticsearchErrorMessage extends ErrorMessage { @Override protected String fetchDetails() { StringBuilder details = new StringBuilder(); if (exception instanceof SearchPhaseExecutionException) { details.append( fetchSearchPhaseExecutionExceptionDetails((SearchPhaseExecutionException) exception)); } else { details.append(((ElasticsearchException) exception).getDetailedMessage()); } details.append( "\nFor more details, please send request for Json format to see the raw response from " + "elasticsearch engine."); return details.toString(); } ElasticsearchErrorMessage(ElasticsearchException exception, int status);   }