logger.info("--> running cluster health");
clusterHealth = client1.admin().cluster().prepareHealth().setWaitForGreenStatus().setWaitForActiveShards(4).execute().actionGet();
logger.info("--> done cluster health, status " + clusterHealth.status());
assertThat(clusterHealth.timedOut(), equalTo(false));
assertThat(clusterHealth.status(), equalTo(ClusterHealthStatus.GREEN));
assertThat(clusterHealth.indices().get("test").activePrimaryShards(), equalTo(2));
assertThat(clusterHealth.indices().get("test").numberOfReplicas(), equalTo(1));
assertThat(clusterHealth.indices().get("test").activeShards(), equalTo(4));
logger.info("--> closing another node");
closeNode("node2");