@Test public void testGetNameAndLeaderId2() { FollowerNodeRole role = new FollowerNodeRole(1, null, NodeId.of("A"), ElectionTimeout.NONE); RoleNameAndLeaderId state = role.getNameAndLeaderId(NodeId.of("B")); Assert.assertEquals(RoleName.FOLLOWER, state.getRoleName()); Assert.assertEquals(NodeId.of("A"), state.getLeaderId()); }
public NodeId getLeaderId() { return leaderId; }
FollowerNodeRole extends AbstractNodeRole { public NodeId getLeaderId() { return leaderId; } }
FollowerNodeRole extends AbstractNodeRole { public NodeId getLeaderId() { return leaderId; } FollowerNodeRole(int term, NodeId votedFor, NodeId leaderId, ElectionTimeout electionTimeout); }
FollowerNodeRole extends AbstractNodeRole { public NodeId getLeaderId() { return leaderId; } FollowerNodeRole(int term, NodeId votedFor, NodeId leaderId, ElectionTimeout electionTimeout); NodeId getVotedFor(); NodeId getLeaderId(); @Override NodeId getLeaderId(NodeId selfId); @Override void cancelTimeoutOrTask(); @Override RoleState getState(); @Override String toString(); }
FollowerNodeRole extends AbstractNodeRole { public NodeId getLeaderId() { return leaderId; } FollowerNodeRole(int term, NodeId votedFor, NodeId leaderId, ElectionTimeout electionTimeout); NodeId getVotedFor(); NodeId getLeaderId(); @Override NodeId getLeaderId(NodeId selfId); @Override void cancelTimeoutOrTask(); @Override RoleState getState(); @Override String toString();  }