@Test
public void testDoUpdateForClusterCreate_SingleHostProperty__defaultValue() throws Exception {

  Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();
  Map<String, String> typeProps = new HashMap<String, String>();
  Map<String, String> typeProps2 = new HashMap<String, String>();
  typeProps.put("yarn.resourcemanager.hostname", "localhost");
  typeProps2.put("oozie_heapsize", "1024");
  typeProps2.put("oozie_permsize", "128");
  properties.put("oozie-env", typeProps2);
  properties.put("yarn-site", typeProps);
  Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap());
  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);
  Set<String> configTypesUpdated =
    updater.doUpdateForClusterCreate();
  String updatedVal = properties.get("yarn-site").get("yarn.resourcemanager.hostname");
  assertEquals("testhost", updatedVal);
  String updatedVal1 = properties.get("oozie-env").get("oozie_heapsize");
  assertEquals("1024m", updatedVal1);
  String updatedVal2 = properties.get("oozie-env").get("oozie_permsize");
  assertEquals("128m", updatedVal2);
  assertEquals("Incorrect number of config types updated",
    3, configTypesUpdated.size());
  assertTrue("Expected config type not updated",
    configTypesUpdated.contains("oozie-env"));
  assertTrue("Expected config type not updated",
    configTypesUpdated.contains("yarn-site"));
  assertTrue("Expected config type not updated",
    configTypesUpdated.contains("cluster-env"));
}