@Test
  public void testMultiParticipants() throws Exception {
    assumeTrue(dataNodeConfigSourceType == DataNodeConfigSourceType.INSTANCE_CONFIG);
    JSONArray zkInfosJson = new JSONArray();
    // create a new zkJson which contains two zk endpoints in the same data center.
    JSONObject zkInfoJson = new JSONObject();
    zkInfoJson.put(ClusterMapUtils.DATACENTER_STR, "DC0");
    zkInfoJson.put(ClusterMapUtils.DATACENTER_ID_STR, (byte) 0);
    zkInfoJson.put(ClusterMapUtils.ZKCONNECT_STR, "localhost:2199" + ZKCONNECT_STR_DELIMITER + "localhost:2299");
    zkInfosJson.put(zkInfoJson);
    JSONObject jsonObject = new JSONObject().put(ClusterMapUtils.ZKINFO_STR, zkInfosJson);
    props.setProperty("clustermap.dcs.zk.connect.strings", jsonObject.toString(2));
    ClusterMapConfig clusterMapConfig = new ClusterMapConfig(new VerifiableProperties(props));
    try {
      List<ClusterParticipant> participants = new HelixClusterAgentsFactoryWithMockClusterMap(clusterMapConfig,
          helixManagerFactory).getClusterParticipants();
      assertEquals("Number of participants is not expected", 2, participants.size());
    } catch (Exception e) {
      throw e;
    } finally {
      // restore previous setup
      props.setProperty("clustermap.dcs.zk.connect.strings", zkJson.toString(2));
    }
  }
Test instantiating multiple {@link HelixParticipant}(s) in {@link HelixClusterAgentsFactory}
@throws Exception
ambry-clustermap/src/test/java/com/github/ambry/clustermap/HelixParticipantTest.java