@Test public void verifyListenerCalledOnNodeChange() throws Exception { final DataPojo created = new DataPojo("foo"); ensure("/foos/foo", created); verify(listener, timeout(60000).atLeastOnce()).nodesChanged(cache); reset(listener); final DataPojo changed = new DataPojo("foo-changed"); zk.curatorWithSuperAuth().setData().forPath("/foos/foo", Json.asBytesUnchecked(changed)); verify(listener, timeout(60000).atLeastOnce()).nodesChanged(cache); final DataPojo read = Iterables.getOnlyElement(cache.getNodes().values()); assertEquals(changed, read); }
public Map<String, T> getNodes() { return snapshot.get(); }
PersistentPathChildrenCache extends AbstractIdleService { public Map<String, T> getNodes() { return snapshot.get(); } }
PersistentPathChildrenCache extends AbstractIdleService { public Map<String, T> getNodes() { return snapshot.get(); } PersistentPathChildrenCache(final CuratorFramework curator, final String path,
                                     final String clusterId, final Path snapshotFile,
                                     final JavaType valueType); }
PersistentPathChildrenCache extends AbstractIdleService { public Map<String, T> getNodes() { return snapshot.get(); } PersistentPathChildrenCache(final CuratorFramework curator, final String path,
                                     final String clusterId, final Path snapshotFile,
                                     final JavaType valueType); void addListener(final Listener listener); void removeListener(final Listener listener); Map<String, T> getNodes(); }
PersistentPathChildrenCache extends AbstractIdleService { public Map<String, T> getNodes() { return snapshot.get(); } PersistentPathChildrenCache(final CuratorFramework curator, final String path,
                                     final String clusterId, final Path snapshotFile,
                                     final JavaType valueType); void addListener(final Listener listener); void removeListener(final Listener listener); Map<String, T> getNodes();  }