@Test
public void testPopulateConfigTypes() throws Exception {

  StackInfo stack = stackManager.getStack("HDP", "2.0.7");
  ServiceInfo hdfsService = stack.getService("HDFS");
  Map<String, Map<String, Map<String, String>>> configTypes = hdfsService.getConfigTypeAttributes();
  assertEquals(4, configTypes.size());
  Map<String, Map<String, String>> configType = configTypes.get("global");
  assertEquals(1, configType.size());
  Map<String, String> supportsMap = configType.get("supports");
  assertEquals(3, supportsMap.size());
  assertEquals("true", supportsMap.get("final"));
  assertEquals("false", supportsMap.get("adding_forbidden"));
  assertEquals("false", supportsMap.get("do_not_extend"));
  configType = configTypes.get("hdfs-site");
  assertEquals(1, configType.size());
  supportsMap = configType.get("supports");
  assertEquals(3, supportsMap.size());
  assertEquals("false", supportsMap.get("final"));
  assertEquals("false", supportsMap.get("adding_forbidden"));
  assertEquals("false", supportsMap.get("do_not_extend"));
  configType = configTypes.get("core-site");
  assertEquals(1, configType.size());
  supportsMap = configType.get("supports");
  assertEquals(3, supportsMap.size());
  assertEquals("false", supportsMap.get("final"));
  assertEquals("false", supportsMap.get("adding_forbidden"));
  assertEquals("false", supportsMap.get("do_not_extend"));
  configType = configTypes.get("hadoop-policy");
  assertEquals(1, configType.size());
  supportsMap = configType.get("supports");
  assertEquals(3, supportsMap.size());
  assertEquals("false", supportsMap.get("final"));
  assertEquals("false", supportsMap.get("adding_forbidden"));
  assertEquals("false", supportsMap.get("do_not_extend"));
  ServiceInfo yarnService = stack.getService("YARN");
  configTypes = yarnService.getConfigTypeAttributes();
  assertEquals(4, configTypes.size());
  assertTrue(configTypes.containsKey("yarn-site"));
  assertTrue(configTypes.containsKey("core-site"));
  assertTrue(configTypes.containsKey("global"));
  assertTrue(configTypes.containsKey("capacity-scheduler"));
  configType = configTypes.get("yarn-site");
  supportsMap = configType.get("supports");
  assertEquals(3, supportsMap.size());
  assertEquals("false", supportsMap.get("final"));
  assertEquals("true", supportsMap.get("adding_forbidden"));
  assertEquals("true", supportsMap.get("do_not_extend"));
  ServiceInfo mrService = stack.getService("MAPREDUCE2");
  configTypes = mrService.getConfigTypeAttributes();
  assertEquals(3, configTypes.size());
  assertTrue(configTypes.containsKey("mapred-site"));
  assertTrue(configTypes.containsKey("core-site"));
  assertTrue(configTypes.containsKey("mapred-queue-acls"));
}