@Test
public void testWithFailover() throws Exception {
LOG.info("------------ testWithFailover-----------");
// Create edits before failover.
createEdits(20);
AvatarNode primary = cluster.getPrimaryAvatar(0).avatar;
AvatarNode standby = cluster.getStandbyAvatar(0).avatar;
assertEquals(20, getCurrentTxId(primary));
// Perform failover and restart old primary.
cluster.failOver();
cluster.restartStandby();
// Get new instances after failover.
primary = cluster.getPrimaryAvatar(0).avatar;
standby = cluster.getStandbyAvatar(0).avatar;
assertEquals(20, getCurrentTxId(primary));
// Create some more edits and verify.
createEdits(20);
standby.quiesceStandby(getCurrentTxId(primary)-1);
assertEquals(40, getCurrentTxId(primary));
assertEquals(getCurrentTxId(primary), getCurrentTxId(standby));
LOG.info("------------ testWithFailover----------- DONE");
}