Assert.assertTrue("Expect desired config contain " + config3.getType(), desiredConfigs.containsKey("core-site"));
Assert.assertEquals("Expect desired config for global should be " + config1.getVersionTag(),
config1.getVersionTag(), desiredConfigs.get(config1.getType()).getVersion());
Assert.assertEquals("_test1", desiredConfigs.get(config1.getType()).getUser());
Assert.assertEquals("_test3", desiredConfigs.get(config3.getType()).getUser());
DesiredConfig dc = desiredConfigs.get(config1.getType());
Assert.assertTrue("Expect no host-level overrides",
(null == dc.getHostOverrides() || dc.getHostOverrides().size() == 0));
c1.addDesiredConfig("_test2", config2);
Assert.assertEquals("_test2", c1.getDesiredConfigs().get(config2.getType()).getUser());
c1.addDesiredConfig("_test1", config1);
// setup a host that also has a config override
Host host = clusters.getHost("h1");
host.addDesiredConfig(c1.getClusterId(), true, "_test2", config2);
desiredConfigs = c1.getDesiredConfigs();
dc = desiredConfigs.get(config1.getType());
Assert.assertNotNull("Expect host-level overrides", dc.getHostOverrides());
Assert.assertEquals("Expect one host-level override", 1, dc.getHostOverrides().size());
}