@Test
public void testDoUpdateForClusterCreate_SingleHostProperty__defaultValue_providedInParent() throws Exception {

  Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();
  Map<String, String> yarnSiteProps = new HashMap<String, String>();
  yarnSiteProps.put("yarn.resourcemanager.hostname", "localhost");
  properties.put("yarn-site", yarnSiteProps);
  Map<String, Map<String, String>> parentProperties = new HashMap<String, Map<String, String>>();
  Map<String, String> parentYarnSiteProps = new HashMap<String, String>();
  parentYarnSiteProps.put("yarn.resourcemanager.resource-tracker.address", "localhost");
  parentProperties.put("yarn-site", parentYarnSiteProps);
  Configuration parentClusterConfig = new Configuration(parentProperties,
      Collections.<String, Map<String, Map<String, String>>>emptyMap());
  Configuration clusterConfig = new Configuration(properties,
      Collections.<String, Map<String, Map<String, String>>>emptyMap(), parentClusterConfig);
  Collection<String> group1Components = new HashSet<String>();
  group1Components.add("NAMENODE");
  group1Components.add("SECONDARY_NAMENODE");
  group1Components.add("RESOURCEMANAGER");
  TestHostGroup group1 = new TestHostGroup("group1", group1Components, Collections.singleton("testhost"));
  Collection<String> group2Components = new HashSet<String>();
  group2Components.add("DATANODE");
  group2Components.add("HDFS_CLIENT");
  TestHostGroup group2 = new TestHostGroup("group2", group2Components, Collections.singleton("testhost2"));
  Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
  hostGroups.add(group1);
  hostGroups.add(group2);
  ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
  BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology);
  updater.doUpdateForClusterCreate();
  assertEquals("testhost", clusterConfig.getPropertyValue("yarn-site", "yarn.resourcemanager.hostname"));
  assertEquals("testhost", clusterConfig.getPropertyValue("yarn-site", "yarn.resourcemanager.resource-tracker.address"));
}