Thread.sleep(wait);
ActionFuture<IndicesExistsResponse> response = getNode().client().admin().indices()
.exists(new IndicesExistsRequest(getIndex()));
assertThat(response.actionGet().isExists(), equalTo(true));
refreshIndex();
CountResponse countResponse = getNode().client().count(countRequest(getIndex())).actionGet();
assertThat(countResponse.getCount(), Matchers.equalTo(1L));
try (DBCursor cursor = mongoDB.getSisterDB(LOCAL_DATABASE_NAME).getCollection(OPLOG_COLLECTION)
.find().sort(new BasicDBObject("$natural", -1)).limit(1)) {
DBObject lastOplog = cursor.toArray().get(0);
assertThat(lastOplog.containsField("ref"), Matchers.is(Boolean.TRUE));
}