@Test
public void testGetBasePath() {

  Configuration conf = new Configuration();
  // Default is empty, everything goes in root znode
  assertEquals("Default value for base path should be empty",
      "", ZooKeeperManager.getBasePath(conf));
  conf.set(GiraphConstants.BASE_ZNODE_KEY, "/howdy");
  assertEquals("Base path should reflect value of " +
      GiraphConstants.BASE_ZNODE_KEY,
      "/howdy", ZooKeeperManager.getBasePath(conf));
  conf.set(GiraphConstants.BASE_ZNODE_KEY, "no_slash");
  try {
    ZooKeeperManager.getBasePath(conf);
    fail("Should not have allowed path without starting slash");
  } catch (IllegalArgumentException iae) {
    assertTrue(iae.getMessage().contains(GiraphConstants.BASE_ZNODE_KEY));
  }
}