public static void sendStateTransitionMessages(HelixManager manager, String resourceName,
      List<? extends ReplicaId> replicaIds, String fromState, String toState) throws Exception {
    StateModelDefinition stateModelDef = AmbryStateModelDefinition.getDefinition();
    assertNotNull(stateModelDef);
    List<org.apache.helix.model.Message> messages = new ArrayList<>();
    for (ReplicaId replica : replicaIds) {
      messages.add(MessageUtil.createStateTransitionMessage(manager.getInstanceName(), manager.getSessionId(),
          new Resource(resourceName), "" + replica.getPartitionId().getId(), manager.getInstanceName(), fromState,
          toState, manager.getSessionId(), stateModelDef.getId()));
    }
    HelixDataAccessor dataAccessor = manager.getHelixDataAccessor();
    PropertyKey.Builder keyBuilder = dataAccessor.keyBuilder();
    List<PropertyKey> keys = new ArrayList<>();
    for (Message message : messages) {
      keys.add(keyBuilder.message(message.getTgtName(), message.getId()));
    }
    for (boolean b : dataAccessor.createChildren(keys, new ArrayList<>(messages))) {
      assertTrue(b);
    }
  }
Send state transition messages to zookeeper so the state transition can happen for the replicas
@param manager {@link HelixManager} to provide connection to zookeeper
@param resourceName The resource name of all the replicas.
@param replicaIds The replicas to send state transition messages.
@param fromState The from state
@param toState The to state
@throws Exception
ambry-clustermap/src/test/java/com/github/ambry/clustermap/TestUtils.java