TerrapinAdmin { public static void unlockFileSet(ZooKeeperManager zkManager, String fileSet) throws Exception { zkManager.unlockFileSet(fileSet); LOG.info(String.format("release %s lock", fileSet)); } TerrapinAdmin(PropertiesConfiguration configuration); void setNamenode(String[] args); void setDfsReplication(String[] args); void checkClusterHealth(String[] args); void rollbackFileSet(String[] args); void deleteFileSet(String[] args); static FileSetInfo lockFileSet(ZooKeeperManager zkManager,
                                        String fileSet,
                                        CreateMode mode); static FileSetInfo lockFileSet(ZooKeeperManager zkManager, String fileSet); static void unlockFileSet(ZooKeeperManager zkManager, String fileSet); static void rollbackFileSet(ZooKeeperManager zkManager, String fileSet,
                                     FileSetInfo fileSetInfo, int versionIndex); static void deleteFileSet(ZooKeeperManager zkManager, String fileSet); static void main(String[] args);  }
@Test public void testUnlockFileSet() throws Exception { ZooKeeperManager mockZKManager = mock(ZooKeeperManager.class); String fileSet = "test_fileset"; doNothing().when(mockZKManager).unlockFileSet(anyString()); TerrapinAdmin.unlockFileSet(mockZKManager, fileSet); verify(mockZKManager, times(1)).unlockFileSet(eq(fileSet)); }