ClusterRequest ucr2 = updateClusterRequest2.iterator().next();
ClusterRequest ucr3 = updateClusterRequest3.iterator().next();
assertEquals(clusterName, ucr1.getClusterName());
assertEquals(clusterName, ucr2.getClusterName());
assertEquals(clusterName, ucr3.getClusterName());
ConfigurationRequest cr1 = ucr1.getDesiredConfig();
ConfigurationRequest cr2 = ucr2.getDesiredConfig();
ConfigurationRequest cr3 = ucr3.getDesiredConfig();
assertEquals("1", cr1.getVersionTag());
assertEquals("1", cr2.getVersionTag());
assertEquals("1", cr3.getVersionTag());
Map<String, ConfigurationRequest> mapConfigRequests = new HashMap<String, ConfigurationRequest>();
mapConfigRequests.put(cr1.getType(), cr1);
mapConfigRequests.put(cr2.getType(), cr2);
mapConfigRequests.put(cr3.getType(), cr3);
assertEquals(3, mapConfigRequests.size());
ConfigurationRequest globalConfigRequest = mapConfigRequests.get("global");
assertEquals(4, 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"));
ConfigurationRequest hdfsConfigRequest = mapConfigRequests.get("hdfs-site");
assertEquals(1, hdfsConfigRequest.getProperties().size());
assertEquals("value2", hdfsConfigRequest.getProperties().get("property2"));
ConfigurationRequest coreConfigRequest = mapConfigRequests.get("core-site");
assertEquals(7, 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"));
assertEquals("foo", coreConfigRequest.getProperties().get("my.missing.password"));
assertEquals("foo", coreConfigRequest.getProperties().get("my.missing.password2"));
assertNull(updateClusterPropertyMapCapture.getValue());
assertNull(updateClusterPropertyMapCapture2.getValue());
assertNull(updateClusterPropertyMapCapture3.getValue());
Request serviceRequest = serviceRequestCapture.getValue();