@Test
public void testKnoxSecurityConfigExported() throws Exception {

  final String expectedHostName = "c6401.apache.ambari.org";
  final String expectedHostNameTwo = "c6402.ambari.apache.org";
  final String expectedHostGroupName = "host_group_1";
  final String expectedHostGroupNameTwo = "host_group_2";
  Map<String, Map<String, String>> configProperties =
      new HashMap<String, Map<String, String>>();
  Map<String, String> coreSiteProperties =
      new HashMap<String, String>();
  Map<String, String> webHCatSiteProperties =
      new HashMap<String, String>();
  Map<String, String> oozieSiteProperties =
      new HashMap<String, String>();
  configProperties.put("core-site", coreSiteProperties);
  configProperties.put("webhcat-site", webHCatSiteProperties);
  configProperties.put("oozie-site", oozieSiteProperties);
  coreSiteProperties.put("hadoop.proxyuser.knox.hosts", expectedHostName + "," + expectedHostNameTwo);
  webHCatSiteProperties.put("webhcat.proxyuser.knox.hosts", expectedHostName + "," + expectedHostNameTwo);
  oozieSiteProperties.put("hadoop.proxyuser.knox.hosts", expectedHostName + "," + expectedHostNameTwo);
  oozieSiteProperties.put("oozie.service.ProxyUserService.proxyuser.knox.hosts", expectedHostName + "," + expectedHostNameTwo);
    multiCoreSiteMap.put("hadoop.proxyuser.knox.hosts", new MultipleHostTopologyUpdater("KNOX_GATEWAY"));
    multiWebhcatSiteMap.put("webhcat.proxyuser.knox.hosts", new MultipleHostTopologyUpdater("KNOX_GATEWAY"));
    multiOozieSiteMap.put("hadoop.proxyuser.knox.hosts", new MultipleHostTopologyUpdater("KNOX_GATEWAY"));
  Configuration clusterConfig = new Configuration(configProperties,
      Collections.<String, Map<String, Map<String, String>>>emptyMap());
  Collection<String> groupComponents = new HashSet<String>();
  groupComponents.add("KNOX_GATEWAY");
  Collection<String> hosts = new ArrayList<String>();
  hosts.add(expectedHostName);
  hosts.add("serverTwo");
  TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts);
  Collection<String> groupComponents2 = new HashSet<String>();
  groupComponents2.add("KNOX_GATEWAY");
  Collection<String> hosts2 = new ArrayList<String>();
  hosts2.add(expectedHostNameTwo);
  hosts2.add("serverFour");
  TestHostGroup group2 = new TestHostGroup(expectedHostGroupNameTwo, groupComponents2, hosts2);
  Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
  hostGroups.add(group);
  hostGroups.add(group2);
  ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
  BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology);
  // call top-level export method
  configProcessor.doUpdateForBlueprintExport();
  assertEquals("Knox for core-site config not properly exported",
      createExportedHostName(expectedHostGroupName) + "," + createExportedHostName(expectedHostGroupNameTwo),
      coreSiteProperties.get("hadoop.proxyuser.knox.hosts"));
  assertEquals("Knox config for WebHCat not properly exported",
      createExportedHostName(expectedHostGroupName) + "," + createExportedHostName(expectedHostGroupNameTwo),
      webHCatSiteProperties.get("webhcat.proxyuser.knox.hosts"));
  assertEquals("Knox config for Oozie not properly exported",
      createExportedHostName(expectedHostGroupName) + "," + createExportedHostName(expectedHostGroupNameTwo),
      oozieSiteProperties.get("hadoop.proxyuser.knox.hosts"));
  assertEquals("Knox config for Oozie not properly exported",
      createExportedHostName(expectedHostGroupName) + "," + createExportedHostName(expectedHostGroupNameTwo),
      oozieSiteProperties.get("oozie.service.ProxyUserService.proxyuser.knox.hosts"));
}