message.setResourceName("TestDB");
message.setTgtName("localhost");
message.setStateModelDef("MasterSlave");
message.setStateModelFactoryName(HelixConstants.DEFAULT_STATE_MODEL_FACTORY);
MockStateModelAnnotated stateModel = new MockStateModelAnnotated();
NotificationContext context;
MockManager manager = new MockManager("clusterName");
// DataAccessor accessor = manager.getDataAccessor();
HelixDataAccessor accessor = manager.getHelixDataAccessor();
StateModelConfigGenerator generator = new StateModelConfigGenerator();
StateModelDefinition stateModelDef = new StateModelDefinition(
generator.generateConfigForMasterSlave());
// accessor.setProperty(PropertyType.STATEMODELDEFS, stateModelDef, "MasterSlave");
Builder keyBuilder = accessor.keyBuilder();
accessor.setProperty(keyBuilder.stateModelDef("MasterSlave"), stateModelDef);
context = new NotificationContext(manager);
CurrentState currentStateDelta = new CurrentState("TestDB");
currentStateDelta.setState("TestDB_0", "OFFLINE");
HelixStateTransitionHandler stHandler = new HelixStateTransitionHandler(stateModel, message,