@Test
public void testGetEncryptionKeyProviderUri() throws Exception {

  //For View with an associated cluster must return the following KeyProvider
  //For View with NO cluster associated with it, getEncryptionKeyProviderUri() won't be called
  String keyProvider = "kms://http@localhost:16000/kms";
  Cluster cluster = createNiceMock(Cluster.class);
  expect(cluster.getConfigurationValue("hdfs-site", "dfs.encryption.key.provider.uri")).andReturn(keyProvider);
  replay(cluster);
  ViewContext viewContext = createNiceMock(ViewContext.class);
  expect(viewContext.getCluster()).andReturn(cluster);
  Map<String, String> instanceProperties = new HashMap<>();
  expect(viewContext.getProperties()).andReturn(instanceProperties).anyTimes();
  replay(viewContext);
  ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(viewContext);
  String encryptionKeyProviderUri = configurationBuilder.getEncryptionKeyProviderUri();
  assertEquals(encryptionKeyProviderUri, keyProvider);
}