@Test
public void testFalconConfigExport() throws Exception {

  final String expectedHostName = "c6401.apache.ambari.org";
  final String expectedPortNum = "808080";
  final String expectedHostGroupName = "host_group_1";
  Map<String, Map<String, String>> configProperties = new HashMap<String, Map<String, String>>();
  Map<String, String> falconStartupProperties = new HashMap<String, String>();
  configProperties.put("falcon-startup.properties", falconStartupProperties);
  // setup properties that include host information
  falconStartupProperties.put("*.broker.url", expectedHostName + ":" + expectedPortNum);
  falconStartupProperties.put("*.falcon.service.authentication.kerberos.principal", "falcon/" + expectedHostName + "@EXAMPLE.COM");
  falconStartupProperties.put("*.falcon.http.authentication.kerberos.principal", "HTTP/" + expectedHostName + "@EXAMPLE.COM");
  Configuration clusterConfig = new Configuration(configProperties,
      Collections.<String, Map<String, Map<String, String>>>emptyMap());
  // note: test hostgroups may not accurately reflect the required components for the config properties
  // which are mapped to them.  Only the hostgroup name is used for hostgroup resolution an the components
  // are not validated
  Collection<String> groupComponents = new HashSet<String>();
  groupComponents.add("FALCON_SERVER");
  Collection<String> hosts = new ArrayList<String>();
  hosts.add(expectedHostName);
  hosts.add("serverTwo");
  TestHostGroup group = new TestHostGroup(expectedHostGroupName, groupComponents, hosts);
  Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
  hostGroups.add(group);
  ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
  BlueprintConfigurationProcessor configProcessor = new BlueprintConfigurationProcessor(topology);
  configProcessor.doUpdateForBlueprintExport();
  assertEquals("Falcon Broker URL property not properly exported",
      createExportedAddress(expectedPortNum, expectedHostGroupName), falconStartupProperties.get("*.broker.url"));
  assertEquals("Falcon Kerberos Principal property not properly exported",
    "falcon/" + "%HOSTGROUP::" + expectedHostGroupName + "%" + "@EXAMPLE.COM", falconStartupProperties.get("*.falcon.service.authentication.kerberos.principal"));
  assertEquals("Falcon Kerberos HTTP Principal property not properly exported",
      "HTTP/" + "%HOSTGROUP::" + expectedHostGroupName + "%" + "@EXAMPLE.COM", falconStartupProperties.get("*.falcon.http.authentication.kerberos.principal"));
}