+ @Test
+ public void testBecomePreLeaderOnReceivingMajorityVotesInThreeNodeCluster(){
+ MockRaftActorContext raftActorContext = createActorContext();
+ raftActorContext.setPeerAddresses(setupPeers(2));
+ candidate = new Candidate(raftActorContext);
+
+ candidate = candidate.handleMessage(peerActors[0], new RequestVoteReply(1, true));
+
+ // LastApplied is -1 and behind the last index.
+ assertEquals("Behavior", RaftState.PreLeader, candidate.state());
+ }
+