@Override
  public ValidationTaskResult validateImpl(Map<String, String> optionMap) {
    // Skip this test if NOSASL
    if (mConf.get(PropertyKey.SECURITY_AUTHENTICATION_TYPE)
            .equals(AuthType.NOSASL)) {
      return new ValidationTaskResult(ValidationUtils.State.SKIPPED, getName(),
              String.format("Impersonation validation is skipped for NOSASL"), "");
    }

    ValidationTaskResult loadConfig = loadHdfsConfig();
    if (loadConfig.getState() != ValidationUtils.State.OK) {
      mAdvice.insert(0, "Validating the proxy user requires additional HDFS "
          + "configuration. ");
      return loadConfig.setAdvice(mAdvice.toString());
    }

    // TODO(jiacheng): validate proxyuser.hosts for the cluster

    // Validate proxyuser config for the current Alluxio user
    try {
      String alluxioUser = getCurrentUser();
      return validateProxyUsers(alluxioUser);
    } catch (UnauthenticatedException e) {
      mMsg.append(String.format("Failed to authenticate in Alluxio: "));
      mMsg.append(ExceptionUtils.asPlainText(e));
      mAdvice.append("Please fix the authentication issue.");
      return new ValidationTaskResult(ValidationUtils.State.FAILED, getName(),
              mMsg.toString(), mAdvice.toString());
    }
  }
@Test
  public void proxyUserNotWildcard() {
    String userName = System.getProperty("user.name");

    // Configured proxy users and groups, but not wildcard
    String proxyUserKey = String.format("hadoop.proxyuser.%s.users", userName);
    String proxyGroupKey = String.format("hadoop.proxyuser.%s.groups", userName);
    prepareHdfsConfFiles(ImmutableMap.of(proxyUserKey, "user1,user2", proxyGroupKey, "groups"));

    HdfsProxyUserValidationTask task =
            new HdfsProxyUserValidationTask("hdfs://namenode:9000/alluxio", mConf);
    ValidationTaskResult result = task.validateImpl(ImmutableMap.of());
    assertEquals(ValidationUtils.State.WARNING, result.getState());
    assertThat(result.getResult(), containsString(
            String.format("%s=user1,user2 and %s=groups", proxyUserKey, proxyGroupKey)));
    assertThat(result.getAdvice(), containsString(
            "Please make sure that includes all users/groups Alluxio needs to impersonate as."));
  }