public static List<ZKUtil.ZKAuthInfo> getZKAuthInfos(Configuration conf,
      String configKey) throws IOException {
    char[] zkAuthChars = conf.getPassword(configKey);
    String zkAuthConf =
        zkAuthChars != null ? String.valueOf(zkAuthChars) : null;
    try {
      zkAuthConf = ZKUtil.resolveConfIndirection(zkAuthConf);
      if (zkAuthConf != null) {
        return ZKUtil.parseAuth(zkAuthConf);
      } else {
        return Collections.emptyList();
      }
    } catch (IOException | ZKUtil.BadAuthFormatException e) {
      LOG.error("Couldn't read Auth based on {}", configKey);
      throw e;
    }
  }
@Test
  public void testAuthPlainPasswordProperty() throws Exception {
    Configuration conf = new Configuration();
    conf.set(CommonConfigurationKeys.ZK_AUTH, ZK_AUTH_VALUE);
    List<ZKAuthInfo> zkAuths = SecurityUtil.getZKAuthInfos(conf,
        CommonConfigurationKeys.ZK_AUTH);
    assertEquals(1, zkAuths.size());
    ZKAuthInfo zkAuthInfo = zkAuths.get(0);
    assertEquals("a_scheme", zkAuthInfo.getScheme());
    assertArrayEquals("a_password".getBytes(), zkAuthInfo.getAuth());
  }