@Test
public void testFactory() throws Exception {

  Configuration conf = new Configuration();
  conf.set(KeyProviderFactory.KEY_PROVIDER_PATH,
      UserProvider.SCHEME_NAME + ":///," +
          JavaKeyStoreProvider.SCHEME_NAME + "://file" + tmpDir + "/test.jks");
  List<KeyProvider> providers = KeyProviderFactory.getProviders(conf);
  assertEquals(2, providers.size());
  assertEquals(UserProvider.class, providers.get(0).getClass());
  assertEquals(JavaKeyStoreProvider.class, providers.get(1).getClass());
  assertEquals(UserProvider.SCHEME_NAME +
      ":///", providers.get(0).toString());
  assertEquals(JavaKeyStoreProvider.SCHEME_NAME +
      "://file" + tmpDir + "/test.jks",
      providers.get(1).toString());
}