code: public void waitToStartCluster(final String clusterName, int nodesCount, int timeout)
      {
          log.debug(String.format(
                  "Waiting  up to %ds for the Elasticsearch cluster to start ...",
                  timeout));
          Awaitility.await()
                  .atMost(timeout, TimeUnit.SECONDS)
                  .pollDelay(1, TimeUnit.SECONDS)
                  .pollInterval(1,  TimeUnit.SECONDS)
                  .until(new Callable<Boolean>()
                          {
                              @Override
                              public Boolean call() throws Exception
                              {
                                  return isClusterRunning(clusterName, nodesCount, client);
                              }
                          }
                  );
          log.info("The Elasticsearch cluster has started");
      }
docs: Wait until the cluster has fully started (ie. all nodes have joined).
  @param clusterName the ES cluster name
  @param nodesCount the number of nodes in the cluster
  @param timeout how many seconds to wait