public static void setSecuredConfiguration(Configuration conf, String servicePrincipal,
    String spnegoPrincipal) {
    setPrincipalForTesting(servicePrincipal);
    setSecuredConfiguration(conf);
    setSecuredHadoopConfiguration(conf, spnegoPrincipal);
  }
Set up configuration for a secure HDFS+HBase cluster.
@param conf             configuration object.
@param servicePrincipal service principal used by NN, HM and RS.
@param spnegoPrincipal  SPNEGO principal used by NN web UI.
hbase-asyncfs/src/test/java/org/apache/hadoop/hbase/security/HBaseKerberosUtils.java