@Test public void testRebuildDoNotUseCache() throws Exception { testee = new ZkNodeCacheWrapper(client, "/test", null); testee.rebuild(); verify(cache, never()).rebuild(); }
@Override public void rebuild() { if ((useCache || useCacheWhenNotConnectedToDataSource) && connector.isConnected()) { try { cache.rebuild(); allowUseCache(); log.debug("Successfully rebuild cache for path={}", path); } catch (Exception e) { log.error("Failed to rebuild cache for path={} {}", path, e); } } }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public void rebuild() { if ((useCache || useCacheWhenNotConnectedToDataSource) && connector.isConnected()) { try { cache.rebuild(); allowUseCache(); log.debug("Successfully rebuild cache for path={}", path); } catch (Exception e) { log.error("Failed to rebuild cache for path={} {}", path, e); } } } }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public void rebuild() { if ((useCache || useCacheWhenNotConnectedToDataSource) && connector.isConnected()) { try { cache.rebuild(); allowUseCache(); log.debug("Successfully rebuild cache for path={}", path); } catch (Exception e) { log.error("Failed to rebuild cache for path={} {}", path, e); } } } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public void rebuild() { if ((useCache || useCacheWhenNotConnectedToDataSource) && connector.isConnected()) { try { cache.rebuild(); allowUseCache(); log.debug("Successfully rebuild cache for path={}", path); } catch (Exception e) { log.error("Failed to rebuild cache for path={} {}", path, e); } } } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); @Override void start(final boolean buildInitial); @Override void addListener(NodeCacheListener listener); @Override void rebuild(); @Override void close(); @Override byte[] getCurrentData(); @Override int getCurrentDataVersion(); @Override String getPath(); boolean isUseCache(); }
ZkNodeCacheWrapper extends BaseCacheWrapper implements INodeCacheWrapper { @Override public void rebuild() { if ((useCache || useCacheWhenNotConnectedToDataSource) && connector.isConnected()) { try { cache.rebuild(); allowUseCache(); log.debug("Successfully rebuild cache for path={}", path); } catch (Exception e) { log.error("Failed to rebuild cache for path={} {}", path, e); } } } ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean dataIsCompressed, boolean useCache, boolean useCacheWhenNotConnectedToDataSource);  ZkNodeCacheWrapper(IDataSourceConnector connector, String path, NodeCache cache, boolean useCache, boolean useCacheWhenNotConnectedToDataSource); @Override void start(final boolean buildInitial); @Override void addListener(NodeCacheListener listener); @Override void rebuild(); @Override void close(); @Override byte[] getCurrentData(); @Override int getCurrentDataVersion(); @Override String getPath(); boolean isUseCache();  }