@Test
public void testDoUpdateForClusterCreate_SingleHostProperty__MissingComponent() throws Exception {

  Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();
  Map<String, String> typeProps = new HashMap<String, String>();
  typeProps.put("yarn.resourcemanager.hostname", "localhost");
  typeProps.put("yarn.timeline-service.address", "localhost");
  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);
  expect(stack.getCardinality("APP_TIMELINE_SERVER")).andReturn(new Cardinality("1")).anyTimes();
  ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
  BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology);
  //todo: should throw a checked exception, not the exception expected by the api
  try {
    updater.doUpdateForClusterCreate();
    fail("IllegalArgumentException should have been thrown");
  } catch (IllegalArgumentException illegalArgumentException) {
    // expected exception
  }
}