private UserGroupInformation getProxyUser() throws IOException {
    UserGroupInformation proxyuser;
    if (authParams.containsKey("proxyuser")) {
      proxyuser = UserGroupInformation.createRemoteUser(authParams.get("proxyuser"));
    } else {
      proxyuser = UserGroupInformation.getCurrentUser();
    }

    proxyuser.setAuthenticationMethod(getAuthenticationMethod());
    return proxyuser;
  }
for testing
@throws IOException
@throws InterruptedException
@throws HdfsApiException
contrib/views/utils/src/main/java/org/apache/ambari/view/utils/hdfs/HdfsApi.java