@Override
  public boolean isOperational() {
    if (nodeOperational) {
      return true;
    }

    boolean flag = false;
    try {
      flag = checkOperational();
    } catch (InterruptedException e) {
      LOG.trace("Interrupted while checking ES node is operational", e);
      Thread.currentThread().interrupt();
    } finally {
      if (flag) {
        esConnector.stop();
        nodeOperational = true;
      }
    }
    return nodeOperational;
  }
@Test
  public void isOperational_if_exception_root_cause_returned_by_ES_is_not_ConnectException_should_return_false() {
    EsConnector esConnector = mock(EsConnector.class);
    when(esConnector.getClusterHealthStatus())
      .thenThrow(new ElasticsearchException(new ExecutionException(new Exception("Connexion refusée"))));
    EsManagedProcess underTest = new EsManagedProcess(mock(Process.class), ProcessId.ELASTICSEARCH, esConnector, WAIT_FOR_UP_TIMEOUT_LONG);
    assertThat(underTest.isOperational()).isFalse();
  }