Code example for Joiner

Methods: join

0
public class TestZookeeperLockManager { 
 
  private static final Joiner SLASH = Joiner.on("/");
  private static final String PARENT = "hive";
  private static final String TABLE = "t1";
  private static final String PARENT_LOCK_PATH = SLASH.join("", PARENT, TABLE);
  private static final String TABLE_LOCK_PATH =  SLASH.join("", PARENT, TABLE, "00001");
  private HiveConf conf;
  private ZooKeeper zooKeeper;
  private HiveLockObject hiveLock;
  private ZooKeeperHiveLock zLock;
 
  @Before 
  public void setup() { 
    conf = new HiveConf();
    zooKeeper = mock(ZooKeeper.class);
    hiveLock = mock(HiveLockObject.class);
    when(hiveLock.getName()).thenReturn(TABLE);
    zLock = new ZooKeeperHiveLock(TABLE_LOCK_PATH, hiveLock, HiveLockMode.SHARED);
  } 
Experience pair programming with AI  Get Codota for Java