@Test public void missingKeyAfterGetChildren() throws Exception { List<String> children = Arrays.asList("1"); AuthenticationKey key1 = new AuthenticationKey(1, 0L, 10000L, keyGen.generateKey()); expect(zk.exists(baseNode, keyWatcher)).andReturn(true); expect(zk.getChildren(baseNode, keyWatcher)).andReturn(children); expect(zk.getData(baseNode + "/" + key1.getKeyId(), keyWatcher, null)) .andThrow(new NoNodeException()); replay(zk); keyWatcher.updateAuthKeys(); verify(zk); assertEquals("Secret manager should be empty after a disconnect", 0, secretManager.getKeys().size()); assertNull("Current key should be null", secretManager.getCurrentKey()); }
public void updateAuthKeys() throws KeeperException, InterruptedException { if (zk.exists(baseNode, this)) { log.info("Added {} existing AuthenticationKeys to local cache from ZooKeeper", updateAuthKeys(baseNode)); } }
ZooAuthenticationKeyWatcher implements Watcher { public void updateAuthKeys() throws KeeperException, InterruptedException { if (zk.exists(baseNode, this)) { log.info("Added {} existing AuthenticationKeys to local cache from ZooKeeper", updateAuthKeys(baseNode)); } } }
ZooAuthenticationKeyWatcher implements Watcher { public void updateAuthKeys() throws KeeperException, InterruptedException { if (zk.exists(baseNode, this)) { log.info("Added {} existing AuthenticationKeys to local cache from ZooKeeper", updateAuthKeys(baseNode)); } } ZooAuthenticationKeyWatcher(AuthenticationTokenSecretManager secretManager, ZooReader zk,
      String baseNode); }
ZooAuthenticationKeyWatcher implements Watcher { public void updateAuthKeys() throws KeeperException, InterruptedException { if (zk.exists(baseNode, this)) { log.info("Added {} existing AuthenticationKeys to local cache from ZooKeeper", updateAuthKeys(baseNode)); } } ZooAuthenticationKeyWatcher(AuthenticationTokenSecretManager secretManager, ZooReader zk,
      String baseNode); @Override void process(WatchedEvent event); void updateAuthKeys(); }
ZooAuthenticationKeyWatcher implements Watcher { public void updateAuthKeys() throws KeeperException, InterruptedException { if (zk.exists(baseNode, this)) { log.info("Added {} existing AuthenticationKeys to local cache from ZooKeeper", updateAuthKeys(baseNode)); } } ZooAuthenticationKeyWatcher(AuthenticationTokenSecretManager secretManager, ZooReader zk,
      String baseNode); @Override void process(WatchedEvent event); void updateAuthKeys();  }