QuorumBean implements QuorumMXBean, ZKMBeanInfo { @Override public boolean isPortUnification() { return peer.shouldUsePortUnification(); } QuorumBean(QuorumPeer peer); @Override String getName(); @Override boolean isHidden(); @Override int getQuorumSize(); @Override boolean isSslQuorum(); @Override boolean isPortUnification();  }
@Test public void testPortUnificationProperty() { QuorumPeer qpMock = mock(QuorumPeer.class); QuorumBean qb = new QuorumBean(qpMock); when(qpMock.shouldUsePortUnification()).thenReturn(true); assertThat("isPortUnification property should return value of peer.shouldUsePortUnification()", qb.isPortUnification(), equalTo(true)); when(qpMock.shouldUsePortUnification()).thenReturn(false); assertThat("isPortUnification property should return value of peer.shouldUsePortUnification()", qb.isPortUnification(), equalTo(false)); }