@Test
public void testUpdateRangerUrlConfigs() throws Exception {

  Map<String, String> oldHdfsProperties = new HashMap<String, String>();
  Map<String, String> newHdfsProperties = new HashMap<String, String>();
  oldHdfsProperties.put("ranger.plugin.hdfs.policy.rest.url", "{{policymgr_mgr_url}}");
  newHdfsProperties.put("ranger.plugin.hdfs.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldHdfsProperties, newHdfsProperties, "ranger-hdfs-security");
  Map<String, String> oldHiveProperties = new HashMap<String, String>();
  Map<String, String> newHiveProperties = new HashMap<String, String>();
  oldHiveProperties.put("ranger.plugin.hive.policy.rest.url", "{{policymgr_mgr_url}}");
  newHiveProperties.put("ranger.plugin.hive.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldHiveProperties, newHiveProperties, "ranger-hive-security");
  Map<String, String> oldHbaseProperties = new HashMap<String, String>();
  Map<String, String> newHbaseProperties = new HashMap<String, String>();
  oldHbaseProperties.put("ranger.plugin.hbase.policy.rest.url", "{{policymgr_mgr_url}}");
  newHbaseProperties.put("ranger.plugin.hbase.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldHbaseProperties, newHbaseProperties, "ranger-hbase-security");
  Map<String, String> oldKnoxProperties = new HashMap<String, String>();
  Map<String, String> newKnoxProperties = new HashMap<String, String>();
  oldKnoxProperties.put("ranger.plugin.knox.policy.rest.url", "{{policymgr_mgr_url}}");
  newKnoxProperties.put("ranger.plugin.knox.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldKnoxProperties, newKnoxProperties, "ranger-knox-security");
  Map<String, String> oldStormProperties = new HashMap<String, String>();
  Map<String, String> newStormProperties = new HashMap<String, String>();
  oldStormProperties.put("ranger.plugin.storm.policy.rest.url", "{{policymgr_mgr_url}}");
  newStormProperties.put("ranger.plugin.storm.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldStormProperties, newStormProperties, "ranger-storm-security");
  Map<String, String> oldYarnProperties = new HashMap<String, String>();
  Map<String, String> newYarnProperties = new HashMap<String, String>();
  oldYarnProperties.put("ranger.plugin.yarn.policy.rest.url", "{{policymgr_mgr_url}}");
  newYarnProperties.put("ranger.plugin.yarn.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldYarnProperties, newYarnProperties, "ranger-yarn-security");
  Map<String, String> oldKafkaProperties = new HashMap<String, String>();
  Map<String, String> newKafkaProperties = new HashMap<String, String>();
  oldKafkaProperties.put("ranger.plugin.kafka.policy.rest.url", "{{policymgr_mgr_url}}");
  newKafkaProperties.put("ranger.plugin.kafka.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldKafkaProperties, newKafkaProperties, "ranger-kafka-security");
  Map<String, String> oldAtlasProperties = new HashMap<String, String>();
  Map<String, String> newAtlasProperties = new HashMap<String, String>();
  oldAtlasProperties.put("ranger.plugin.atlas.policy.rest.url", "{{policymgr_mgr_url}}");
  newAtlasProperties.put("ranger.plugin.atlas.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldAtlasProperties, newAtlasProperties, "ranger-atlas-security");
  Map<String, String> oldKmsProperties = new HashMap<String, String>();
  Map<String, String> newKmsProperties = new HashMap<String, String>();
  oldKmsProperties.put("ranger.plugin.kms.policy.rest.url", "{{policymgr_mgr_url}}");
  newKmsProperties.put("ranger.plugin.kms.policy.rest.url", "http://localhost:6080");
  testUpdateRangerUrl(oldKmsProperties, newKmsProperties, "ranger-kms-security");
}