Github user nkalmar commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/549#discussion_r198405834 --- Diff: src/java/test/org/apache/zookeeper/server/quorum/QuorumPeerConfigTest.java --- @@ -103,6 +103,23 @@ public void testCustomSSLAuth() } } + /** + * Test case for https://issues.apache.org/jira/browse/ZOOKEEPER-2873 + */ + @Test + public void testSamePortConfiguredForClientAndElection() throws IOException, ConfigException { + QuorumPeerConfig quorumPeerConfig = new QuorumPeerConfig(); + try { + Properties zkProp = getDefaultZKProperties(); + zkProp.setProperty("server.1", "localhost:2888:2888"); + quorumPeerConfig.parseProperties(zkProp); + fail("ConfigException is expected"); + } catch (ConfigException ce) { --- End diff -- That will only verify the exception was thrown. I am also checking what is the error message. We can use expected, but I think this is more "To the point"
---