@Test
public void testResolve_ConfigDependencies() throws Exception {

  List<String> configDependencies = new ArrayList<String>();
  configDependencies.add("foo");
  configDependencies.add("bar");
  // specified in child only
  ServiceInfo info = new ServiceInfo();
  ServiceInfo parentInfo = new ServiceInfo();
  info.setConfigDependencies(configDependencies);
  ServiceModule service = resolveService(info, parentInfo);
  assertEquals(configDependencies, service.getModuleInfo().getConfigDependencies());
  // specified in parent only
  info.setConfigDependencies(null);
  parentInfo.setConfigDependencies(configDependencies);
  service = resolveService(info, parentInfo);
  assertEquals(configDependencies, service.getModuleInfo().getConfigDependencies());
  // specified in both
  List<String> parentCustomCommands = new ArrayList<String>();
  parentCustomCommands.add("bar");
  parentCustomCommands.add("other");
  info.setConfigDependencies(configDependencies);
  parentInfo.setConfigDependencies(parentCustomCommands);
  service = resolveService(info, parentInfo);
  Collection<String> mergedConfigDependencies =  service.getModuleInfo().getConfigDependencies();
  assertEquals(3, mergedConfigDependencies.size());
  assertTrue(mergedConfigDependencies.contains("foo"));
  assertTrue(mergedConfigDependencies.contains("bar"));
  assertTrue(mergedConfigDependencies.contains("other"));
  // not set in either
  info.setConfigDependencies(null);
  parentInfo.setConfigDependencies(null);
  service = resolveService(info, parentInfo);
  assertTrue(service.getModuleInfo().getConfigDependencies().isEmpty());
}