@Test public void testGetClientAddressShouldReturnEmptyStringWhenClientAddressIsNull() { InetSocketAddress peerCommunicationAddress = null; QuorumServer peer = new QuorumServer(1, peerCommunicationAddress); RemotePeerBean remotePeerBean = new RemotePeerBean(null, peer); String clientAddress = remotePeerBean.getClientAddress(); assertNotNull(clientAddress); assertEquals(0, clientAddress.length()); }
public String getClientAddress() { if (null == peer.clientAddr) { return ""; } return peer.clientAddr.getHostString() + ":" + peer.clientAddr.getPort(); }
RemotePeerBean implements RemotePeerMXBean,ZKMBeanInfo { public String getClientAddress() { if (null == peer.clientAddr) { return ""; } return peer.clientAddr.getHostString() + ":" + peer.clientAddr.getPort(); } }
RemotePeerBean implements RemotePeerMXBean,ZKMBeanInfo { public String getClientAddress() { if (null == peer.clientAddr) { return ""; } return peer.clientAddr.getHostString() + ":" + peer.clientAddr.getPort(); } RemotePeerBean(QuorumPeer localPeer, QuorumPeer.QuorumServer peer); }
RemotePeerBean implements RemotePeerMXBean,ZKMBeanInfo { public String getClientAddress() { if (null == peer.clientAddr) { return ""; } return peer.clientAddr.getHostString() + ":" + peer.clientAddr.getPort(); } RemotePeerBean(QuorumPeer localPeer, QuorumPeer.QuorumServer peer); void setQuorumServer(QuorumPeer.QuorumServer peer); String getName(); boolean isHidden(); String getQuorumAddress(); String getElectionAddress(); String getClientAddress(); String getLearnerType(); @Override boolean isLeader(); }
RemotePeerBean implements RemotePeerMXBean,ZKMBeanInfo { public String getClientAddress() { if (null == peer.clientAddr) { return ""; } return peer.clientAddr.getHostString() + ":" + peer.clientAddr.getPort(); } RemotePeerBean(QuorumPeer localPeer, QuorumPeer.QuorumServer peer); void setQuorumServer(QuorumPeer.QuorumServer peer); String getName(); boolean isHidden(); String getQuorumAddress(); String getElectionAddress(); String getClientAddress(); String getLearnerType(); @Override boolean isLeader();  }