@Test
public void testDoUpdateForClusterCreate_MultiHostProperty__exportedValues___withPorts_UsingMinusSymbolInHostGroupName() throws Exception {

  Map<String, Map<String, String>> properties = new HashMap<String, Map<String, String>>();
  Map<String, String> typeProps = new HashMap<String, String>();
  typeProps.put("ha.zookeeper.quorum", "%HOSTGROUP::os-amb-r6-secha-1427972156-hbaseha-3-6%:2181,%HOSTGROUP::os-amb-r6-secha-1427972156-hbaseha-3-5%:2181,%HOSTGROUP::os-amb-r6-secha-1427972156-hbaseha-3-7%:2181");
  properties.put("core-site", typeProps);
  Configuration clusterConfig = new Configuration(properties, Collections.<String, Map<String, Map<String, String>>>emptyMap());
  Collection<String> hgComponents = new HashSet<String>();
  hgComponents.add("NAMENODE");
  hgComponents.add("SECONDARY_NAMENODE");
  hgComponents.add("ZOOKEEPER_SERVER");
  TestHostGroup group1 = new TestHostGroup("os-amb-r6-secha-1427972156-hbaseha-3-6", hgComponents, Collections.singleton("testhost"));
  Collection<String> hgComponents2 = new HashSet<String>();
  hgComponents2.add("DATANODE");
  hgComponents2.add("HDFS_CLIENT");
  hgComponents2.add("ZOOKEEPER_SERVER");
  Set<String> hosts2 = new HashSet<String>();
  hosts2.add("testhost2");
  hosts2.add("testhost2a");
  hosts2.add("testhost2b");
  TestHostGroup group2 = new TestHostGroup("os-amb-r6-secha-1427972156-hbaseha-3-5", hgComponents2, hosts2);
  Collection<String> hgComponents3 = new HashSet<String>();
  hgComponents2.add("HDFS_CLIENT");
  hgComponents2.add("ZOOKEEPER_CLIENT");
  Set<String> hosts3 = new HashSet<String>();
  hosts3.add("testhost3");
  hosts3.add("testhost3a");
  TestHostGroup group3 = new TestHostGroup("os-amb-r6-secha-1427972156-hbaseha-3-7", hgComponents3, hosts3);
  Collection<TestHostGroup> hostGroups = new HashSet<TestHostGroup>();
  hostGroups.add(group1);
  hostGroups.add(group2);
  hostGroups.add(group3);
  ClusterTopology topology = createClusterTopology(bp, clusterConfig, hostGroups);
  BlueprintConfigurationProcessor updater = new BlueprintConfigurationProcessor(topology);
  updater.doUpdateForClusterCreate();
  String updatedVal = topology.getConfiguration().getFullProperties().get("core-site").get("ha.zookeeper.quorum");
  String[] hosts = updatedVal.split(",");
  Collection<String> expectedHosts = new HashSet<String>();
  expectedHosts.add("testhost:2181");
  expectedHosts.add("testhost2:2181");
  expectedHosts.add("testhost2a:2181");
  expectedHosts.add("testhost2b:2181");
  expectedHosts.add("testhost3:2181");
  expectedHosts.add("testhost3a:2181");
  assertEquals(6, hosts.length);
  for (String host : hosts) {
    assertTrue("Expected host :" + host + "was not included in the multi-server list in this property.", expectedHosts.contains(host));
    expectedHosts.remove(host);
  }
}