use of com.hazelcast.cp.internal.raft.impl.log.RaftLog in project hazelcast by hazelcast.
the class RaftStateTest method test_initialState.
@Test
public void test_initialState() {
assertEquals(name, state.name());
assertEquals(groupId, state.groupId());
assertEquals(members.size(), state.memberCount());
assertEquals(members, state.members());
Collection<RaftEndpoint> remoteMembers = new HashSet<RaftEndpoint>(members);
remoteMembers.remove(localMember);
assertEquals(remoteMembers, state.remoteMembers());
assertEquals(0, state.term());
assertEquals(RaftRole.FOLLOWER, state.role());
assertNull(state.leader());
assertEquals(0, state.commitIndex());
assertEquals(0, state.lastApplied());
assertEquals(3, state.majority());
assertNull(state.votedFor());
assertNull(state.leaderState());
assertNull(state.candidateState());
RaftLog log = state.log();
assertEquals(0, log.lastLogOrSnapshotIndex());
assertEquals(0, log.lastLogOrSnapshotTerm());
}
Aggregations