@Test
public void testHandleAppendEntriesReplySuccess() {

    logStart("testHandleAppendEntriesReplySuccess");
    MockRaftActorContext leaderActorContext = createActorContextWithFollower();
    leaderActorContext.setReplicatedLog(
            new MockRaftActorContext.MockReplicatedLogBuilder().createEntries(0, 3, 1).build());
    leaderActorContext.setCommitIndex(1);
    leaderActorContext.setLastApplied(1);
    leaderActorContext.getTermInformation().update(1, "leader");
    leader = new Leader(leaderActorContext);
    FollowerLogInformation followerInfo = leader.getFollower(FOLLOWER_ID);
    assertEquals(payloadVersion, leader.getLeaderPayloadVersion());
    assertEquals(RaftVersions.HELIUM_VERSION, followerInfo.getRaftVersion());
    AppendEntriesReply reply = new AppendEntriesReply(FOLLOWER_ID, 1, true, 2, 1, payloadVersion);
    RaftActorBehavior raftActorBehavior = leader.handleAppendEntriesReply(followerActor, reply);
    assertEquals(RaftState.Leader, raftActorBehavior.state());
    assertEquals(2, leaderActorContext.getCommitIndex());
    ApplyJournalEntries applyJournalEntries = MessageCollectorActor.expectFirstMatching(
            leaderActor, ApplyJournalEntries.class);
    assertEquals(2, leaderActorContext.getLastApplied());
    assertEquals(2, applyJournalEntries.getToIndex());
    List<ApplyState> applyStateList = MessageCollectorActor.getAllMatching(leaderActor,
            ApplyState.class);
    assertEquals(1,applyStateList.size());
    ApplyState applyState = applyStateList.get(0);
    assertEquals(2, applyState.getReplicatedLogEntry().getIndex());
    assertEquals(2, followerInfo.getMatchIndex());
    assertEquals(3, followerInfo.getNextIndex());
    assertEquals(payloadVersion, followerInfo.getPayloadVersion());
    assertEquals(RaftVersions.CURRENT_VERSION, followerInfo.getRaftVersion());
}