@Test
  public void testHelixParticipant() throws Exception {
    props.setProperty(ClusterMapConfig.ENABLE_PROPERTY_STORE_CLEAN_UP_TASK, Boolean.toString(false));
    ClusterMapConfig clusterMapConfig = new ClusterMapConfig(new VerifiableProperties(props));
    HelixParticipant participant =
        new HelixParticipant(mock(HelixClusterManager.class), clusterMapConfig, helixManagerFactory,
            new MetricRegistry(), getDefaultZkConnectStr(clusterMapConfig), true);
    assertTrue(helixManagerFactory.getHelixManager(InstanceType.SPECTATOR).isConnected());
    assertFalse(helixManagerFactory.getHelixManager(InstanceType.PARTICIPANT).isConnected());

    participant.participateAndBlockStateTransition(Collections.emptyList(), null, null);
    participant.unblockStateTransition();
    MockHelixManagerFactory.MockHelixManager helixManager =
        helixManagerFactory.getHelixManager(InstanceType.PARTICIPANT);
    assertTrue(helixManager.isConnected());
    assertEquals(stateModelDef, helixManager.getStateModelDef());
    assertEquals(AmbryStateModelFactory.class, helixManager.getStateModelFactory().getClass());
    participant.close();
    assertFalse(helixManager.isConnected());
  }
Test the good path of instantiation, initialization and termination of the {@link HelixParticipant}
@throws Exception
ambry-clustermap/src/test/java/com/github/ambry/clustermap/HelixParticipantTest.java