ByteString subid = ByteString.copyFromUtf8("testGCSubId");
sub.subscribe(topic, subid, CreateOrAttach.CREATE_OR_ATTACH);
sub.closeSubscription(topic, subid);
for (int i = 1; i <= 100; i++) {
pub.publish(topic, Message.newBuilder().setBody(
ByteString.copyFromUtf8(String.valueOf(i))).build());
}
LedgerRanges r = LedgerRanges.parseFrom(bktb.getZooKeeperClient().getData(ledgersPath, false, null));
assertEquals("Should only have 1 ledger yet", 1, r.getRangesList().size());
long firstLedger = r.getRangesList().get(0).getLedgerId();