@Test
public void testHiveConfigClusterUpdateSpecifyingHostNamesHiveServer2HA() throws Exception {

  final String expectedHostGroupName = "host_group_1";
  final String expectedMetaStoreURIs = "thrift://c6401.ambari.apache.org:9083,thrift://c6402.ambari.apache.org:9083";
  Map<String, Map<String, String>> configProperties =
      new HashMap<String, Map<String, String>>();
  Map<String, String> hiveEnvProperties =
      new HashMap<String, String>();
  Map<String, String> hiveSiteProperties =
      new HashMap<String, String>();
  configProperties.put("hive-env", hiveEnvProperties);
  configProperties.put("hive-site", hiveSiteProperties);
  // simulate HA mode, since this property must be present in HiveServer2 HA
  hiveSiteProperties.put("hive.server2.support.dynamic.service.discovery", "true");
  // set MetaStore URIs property to reflect an HA environment for HIVE_METASTORE
  hiveSiteProperties.put("hive.metastore.uris", expectedMetaStoreURIs);
  Configuration clusterConfig = new Configuration(configProperties, Collections.<String, Map<String, Map<String, String>>>emptyMap());
  Collection<String> hgComponents = new HashSet<String>();
  hgComponents.add("HIVE_SERVER");
  TestHostGroup group1 = new TestHostGroup(expectedHostGroupName, hgComponents, Collections.singleton("some-host"));
  Collection<String> hgComponents2 = new HashSet<String>();
  hgComponents2.add("HIVE_SERVER");
  TestHostGroup group2 = new TestHostGroup("host_group_2", hgComponents2, Collections.singleton("some-host2"));
  Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
  hostGroups.add(group1);
  hostGroups.add(group2);
  expect(stack.getCardinality("HIVE_SERVER")).andReturn(new Cardinality("1+")).anyTimes();
  ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
  BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology);
  updater.doUpdateForClusterCreate();
  assertEquals("Unexpected config update for hive.metastore.uris",
      expectedMetaStoreURIs,
      hiveSiteProperties.get("hive.metastore.uris"));
}