@Test public void testGetRoleNameAndLeaderId() { CandidateNodeRole role = new CandidateNodeRole(1, ElectionTimeout.NONE); RoleNameAndLeaderId state = role.getNameAndLeaderId(NodeId.of("A")); Assert.assertEquals(RoleName.CANDIDATE, state.getRoleName()); Assert.assertNull(state.getLeaderId()); }
@Override public NodeId getLeaderId(NodeId selfId) { return null; }
CandidateNodeRole extends AbstractNodeRole { @Override public NodeId getLeaderId(NodeId selfId) { return null; } }
CandidateNodeRole extends AbstractNodeRole { @Override public NodeId getLeaderId(NodeId selfId) { return null; } CandidateNodeRole(int term, ElectionTimeout electionTimeout);  CandidateNodeRole(int term, int votesCount, ElectionTimeout electionTimeout); }
CandidateNodeRole extends AbstractNodeRole { @Override public NodeId getLeaderId(NodeId selfId) { return null; } CandidateNodeRole(int term, ElectionTimeout electionTimeout);  CandidateNodeRole(int term, int votesCount, ElectionTimeout electionTimeout); int getVotesCount(); @Override NodeId getLeaderId(NodeId selfId); @Override void cancelTimeoutOrTask(); @Override RoleState getState(); @Override String toString(); }
CandidateNodeRole extends AbstractNodeRole { @Override public NodeId getLeaderId(NodeId selfId) { return null; } CandidateNodeRole(int term, ElectionTimeout electionTimeout);  CandidateNodeRole(int term, int votesCount, ElectionTimeout electionTimeout); int getVotesCount(); @Override NodeId getLeaderId(NodeId selfId); @Override void cancelTimeoutOrTask(); @Override RoleState getState(); @Override String toString();  }