ClusterRequest ucr4 = updateClusterRequest4.iterator().next();
assertEquals(clusterName, ucr1.getClusterName());
assertEquals(clusterName, ucr2.getClusterName());
assertEquals(clusterName, ucr3.getClusterName());
assertEquals(clusterName, ucr4.getClusterName());
ConfigurationRequest cr1 = ucr1.getDesiredConfig();
ConfigurationRequest cr2 = ucr2.getDesiredConfig();
ConfigurationRequest cr3 = ucr3.getDesiredConfig();
ConfigurationRequest cr4 = ucr4.getDesiredConfig();
assertEquals("1", cr1.getVersionTag());
assertEquals("1", cr2.getVersionTag());
assertEquals("1", cr3.getVersionTag());
assertEquals("1", cr4.getVersionTag());
Map<String, ConfigurationRequest> mapConfigRequests = new HashMap<String, ConfigurationRequest>();
mapConfigRequests.put(cr1.getType(), cr1);
mapConfigRequests.put(cr2.getType(), cr2);
mapConfigRequests.put(cr3.getType(), cr3);
mapConfigRequests.put(cr4.getType(), cr4);
assertEquals(4, mapConfigRequests.size());
ConfigurationRequest globalConfigRequest = mapConfigRequests.get("global");
assertEquals(5, globalConfigRequest.getProperties().size());
assertEquals("hadoop", globalConfigRequest.getProperties().get("user_group"));
assertEquals("ambari-qa", globalConfigRequest.getProperties().get("smokeuser"));
assertEquals("default@REPLACEME.NOWHERE", globalConfigRequest.getProperties().get("nagios_contact"));
assertEquals("oozie", globalConfigRequest.getProperties().get("oozie_user"));
assertEquals("New MySQL Database", globalConfigRequest.getProperties().get("hive_database"));
ConfigurationRequest hdfsConfigRequest = mapConfigRequests.get("hdfs-site");
assertEquals(1, hdfsConfigRequest.getProperties().size());
assertEquals("value2", hdfsConfigRequest.getProperties().get("property2"));
ConfigurationRequest coreConfigRequest = mapConfigRequests.get("core-site");
assertEquals(5, coreConfigRequest.getProperties().size());
assertEquals("value2", coreConfigRequest.getProperties().get("property1"));
assertEquals("value3", coreConfigRequest.getProperties().get("property3"));
assertEquals("*", coreConfigRequest.getProperties().get("hadoop.proxyuser.oozie.hosts"));
assertEquals("users", coreConfigRequest.getProperties().get("hadoop.proxyuser.oozie.groups"));
assertEquals("new.property.value", coreConfigRequest.getProperties().get("new.property"));
ConfigurationRequest hiveConfigRequest = mapConfigRequests.get("hive-site");
assertEquals(1, hiveConfigRequest.getProperties().size());
assertEquals("host.domain:12345", hiveConfigRequest.getProperties().get("javax.jdo.option.ConnectionURL"));
assertNull(updateClusterPropertyMapCapture.getValue());
assertNull(updateClusterPropertyMapCapture2.getValue());
assertNull(updateClusterPropertyMapCapture3.getValue());
assertNull(updateClusterPropertyMapCapture4.getValue());