@Test public void testLocalPeerIsNotLeader() throws Exception { long localPeerId = 7; QuorumPeer peer = mock(QuorumPeer.class); when(peer.getId()).thenReturn(localPeerId); when(peer.isLeader(eq(localPeerId))).thenReturn(false); LocalPeerBean localPeerBean = new LocalPeerBean(peer); assertFalse(localPeerBean.isLeader()); }
@Override public boolean isLeader() { return peer.isLeader(peer.getId()); }
LocalPeerBean extends ServerBean implements LocalPeerMXBean { @Override public boolean isLeader() { return peer.isLeader(peer.getId()); } }
LocalPeerBean extends ServerBean implements LocalPeerMXBean { @Override public boolean isLeader() { return peer.isLeader(peer.getId()); } LocalPeerBean(QuorumPeer peer); }
LocalPeerBean extends ServerBean implements LocalPeerMXBean { @Override public boolean isLeader() { return peer.isLeader(peer.getId()); } LocalPeerBean(QuorumPeer peer); String getName(); boolean isHidden(); int getTickTime(); int getMaxClientCnxnsPerHost(); int getMinSessionTimeout(); int getMaxSessionTimeout(); int getInitLimit(); int getSyncLimit(); int getTick(); String getState(); String getQuorumAddress(); int getElectionType(); String getElectionAddress(); String getClientAddress(); String getLearnerType(); long getConfigVersion(); @Override String getQuorumSystemInfo(); @Override boolean isPartOfEnsemble(); @Override boolean isLeader(); }
LocalPeerBean extends ServerBean implements LocalPeerMXBean { @Override public boolean isLeader() { return peer.isLeader(peer.getId()); } LocalPeerBean(QuorumPeer peer); String getName(); boolean isHidden(); int getTickTime(); int getMaxClientCnxnsPerHost(); int getMinSessionTimeout(); int getMaxSessionTimeout(); int getInitLimit(); int getSyncLimit(); int getTick(); String getState(); String getQuorumAddress(); int getElectionType(); String getElectionAddress(); String getClientAddress(); String getLearnerType(); long getConfigVersion(); @Override String getQuorumSystemInfo(); @Override boolean isPartOfEnsemble(); @Override boolean isLeader();  }