ZooKeeperManager { public ViewInfo getViewInfo(String resource) { if (viewInfoMap == null) { throw new UnsupportedOperationException("Watch is not established on " + clusterViewsPath); } return viewInfoMap.get(resource); } ZooKeeperManager(ZooKeeperClient zkClient, String clusterName); void createClusterPaths(); void registerWatchAllFileSets(); void lockFileSet(String fileSet,
                          FileSetInfo fileSetInfo,
                          CreateMode mode); void lockFileSet(String fileSet,
                          FileSetInfo fileSetInfo); void unlockFileSet(String fileSet); void setFileSetInfo(String fileSet,
                             FileSetInfo fileSetInfo); void deleteFileSetInfo(String fileSet); FileSetInfo getFileSetInfo(String fileSet); ViewInfo getViewInfo(String resource); void setViewInfo(ViewInfo viewInfo); void deleteViewInfo(String resource); FileSetInfo getFileSetInfoForced(String fileSet); FileSetInfo getLockedFileSetInfo(String fileSet); Map<String, Pair<FileSetInfo, FileSetInfo>> getCandidateHdfsDirMap(); InetSocketAddress getControllerLeader(); ClusterInfo getClusterInfo(); void setClusterInfo(ClusterInfo info); Map<String, FileSetInfo> getFileSetInfoMap(); List<String> getLockedFileSets(); List<String> getLiveInstances();  }
@Test public void testGetViewInfo() throws Exception { PowerMockito.mockStatic(ZooKeeperMap.class); ViewInfo viewInfo = new ViewInfo(); String resource1 = "test_view"; MemberModifier.field(ZooKeeperManager.class, "viewInfoMap") .set(zkManager, ImmutableMap.of(resource1, viewInfo)); assertNotNull(zkManager.getViewInfo(resource1)); assertNull(zkManager.getViewInfo("non_existing")); }