use of org.apache.helix.mock.MockZkClient in project helix by apache.
the class TestHelixDataAccessor method beforeClass.
@BeforeClass
public void beforeClass() {
_zkClient = new MockZkClient(ZK_ADDR);
baseDataAccessor = new ZkBaseDataAccessor<>(_zkClient);
accessor = new ZKHelixDataAccessor("HELIX", baseDataAccessor);
Map<String, HelixProperty> paths = new TreeMap<>();
propertyKeys = new ArrayList<>();
for (int i = 0; i < 5; i++) {
PropertyKey key = accessor.keyBuilder().idealStates("RESOURCE" + i);
propertyKeys.add(key);
paths.put(key.getPath(), new HelixProperty("RESOURCE" + i));
accessor.setProperty(key, paths.get(key.getPath()));
}
List<HelixProperty> data = accessor.getProperty(new ArrayList<>(propertyKeys), true);
Assert.assertEquals(data.size(), 5);
PropertyKey key = accessor.keyBuilder().idealStates("RESOURCE6");
propertyKeys.add(key);
_zkClient.putData(key.getPath(), null);
}
Aggregations