@Test
public void testWaitForTopologyResolvedStateWithRequiredUpdatedSet() throws Exception {

  final String topologyResolvedState = "TOPOLOGY_RESOLVED";
  DesiredConfig testHdfsDesiredConfig =
    new DesiredConfig();
  testHdfsDesiredConfig.setTag(topologyResolvedState);
  DesiredConfig testCoreSiteDesiredConfig =
    new DesiredConfig();
  testCoreSiteDesiredConfig.setTag(topologyResolvedState);
  DesiredConfig testClusterEnvDesiredConfig =
    new DesiredConfig();
  testClusterEnvDesiredConfig.setTag(topologyResolvedState);
  Map<String, DesiredConfig> testDesiredConfigs =
    new HashMap<String, DesiredConfig>();
  testDesiredConfigs.put("hdfs-site", testHdfsDesiredConfig);
  testDesiredConfigs.put("core-site", testCoreSiteDesiredConfig);
  testDesiredConfigs.put("cluster-env", testClusterEnvDesiredConfig);
  expect(cluster.getDesiredConfigs()).andReturn(testDesiredConfigs).atLeastOnce();
  replayAll();
  Set<String> testUpdatedConfigTypes =
    new HashSet<String>();
  testUpdatedConfigTypes.add("hdfs-site");
  testUpdatedConfigTypes.add("core-site");
  testUpdatedConfigTypes.add("cluster-env");
  // verify that wait returns successfully with non-empty list
  // with all configuration types tagged as "TOPOLOGY_RESOLVED"
  context.waitForConfigurationResolution(CLUSTER_NAME, testUpdatedConfigTypes);
}