@Test public void extractFromHdfs() throws Exception { File target = new File(System.getProperty("user.dir"), "target"); String prevValue = System.setProperty("test.build.data", new File(target, this.getClass().getName() + "_minidfs").toString()); MiniDFSCluster dfsCluster = new MiniDFSCluster.Builder(new Configuration()).build(); try { if (null != prevValue) { System.setProperty("test.build.data", prevValue); } else { System.clearProperty("test.build.data"); } Configuration dfsConfiguration = dfsCluster.getConfiguration(0); Path destPath = new Path("/accumulo.jceks"); FileSystem dfs = dfsCluster.getFileSystem(); dfs.copyFromLocalFile(new Path(populatedKeyStore.toURI()), destPath); Configuration cpConf = dfsConfiguration; HadoopCredentialProvider.setPath(cpConf, "jceks: Map<String,String> expectations = new HashMap<>(); expectations.put("key1", "value1"); expectations.put("key2", "value2"); checkCredentialProviders(cpConf, expectations); } finally { dfsCluster.shutdown(); } }
public static void setPath(Configuration conf, String path) { conf.set(CREDENTIAL_PROVIDER_PATH, path); }
HadoopCredentialProvider { public static void setPath(Configuration conf, String path) { conf.set(CREDENTIAL_PROVIDER_PATH, path); } }
HadoopCredentialProvider { public static void setPath(Configuration conf, String path) { conf.set(CREDENTIAL_PROVIDER_PATH, path); }  }
HadoopCredentialProvider { public static void setPath(Configuration conf, String path) { conf.set(CREDENTIAL_PROVIDER_PATH, path); }  static void setPath(Configuration conf, String path); static char[] getValue(Configuration conf, String alias); static List<String> getKeys(Configuration conf); static void createEntry(Configuration conf, String name, char[] credential); }
HadoopCredentialProvider { public static void setPath(Configuration conf, String path) { conf.set(CREDENTIAL_PROVIDER_PATH, path); }  static void setPath(Configuration conf, String path); static char[] getValue(Configuration conf, String alias); static List<String> getKeys(Configuration conf); static void createEntry(Configuration conf, String name, char[] credential);  }