@Test
public void testResolve_Configuration__properties() throws Exception {

  ServiceInfo info = new ServiceInfo();
  ServiceInfo parentInfo = new ServiceInfo();
  // child configurations
  //FOO
  Collection<PropertyInfo> childFooProperties = new ArrayList<PropertyInfo>();
  PropertyInfo childProp1 = new PropertyInfo();
  childProp1.setName("childName1");
  childProp1.setValue("childVal1");
  childFooProperties.add(childProp1);
  //BAR : Doesn't inherit parents BAR due to attribute Supports.DO_NOT_EXTEND
  Collection<PropertyInfo> childBarProperties = new ArrayList<PropertyInfo>();
  PropertyInfo childProp2 = new PropertyInfo();
  childProp2.setName("childName2");
  childProp2.setValue("childVal2");
  childBarProperties.add(childProp2);
  // add attributes for BAR
  Map<String, String> attributes = new HashMap<String, String>();
  attributes.put(ConfigurationInfo.Supports.DO_NOT_EXTEND.getXmlAttributeName(), "true");
  // create child config modules
  ConfigurationModule childConfigModule1 = createConfigurationModule("FOO", childFooProperties);
  ConfigurationModule childConfigModule2 = createConfigurationModule("BAR", childBarProperties, attributes);
  Collection<ConfigurationModule> childModules = new ArrayList<ConfigurationModule>();
  childModules.add(childConfigModule1);
  childModules.add(childConfigModule2);
  // parent configurations
  //FOO
  Collection<PropertyInfo> parentFooProperties = new ArrayList<PropertyInfo>();
  PropertyInfo parentProp1 = new PropertyInfo();
  parentProp1.setName("parentName1");
  parentProp1.setValue("parentVal1");
  parentFooProperties.add(parentProp1);
  PropertyInfo parentProp12 = new PropertyInfo();
  // overwritten by child
  parentProp12.setName("childName1");
  parentProp12.setValue("parentVal1");
  parentFooProperties.add(parentProp12);
  //BAR
  Collection<PropertyInfo> parentBarProperties = new ArrayList<PropertyInfo>();
  PropertyInfo parentProp2 = new PropertyInfo();
  parentProp2.setName("parentName2");
  parentProp2.setValue("parentVal2");
  parentBarProperties.add(parentProp2);
  //OTHER
  Collection<PropertyInfo> parentOtherProperties = new ArrayList<PropertyInfo>();
  PropertyInfo parentProp3 = new PropertyInfo();
  parentProp3.setName("parentName3");
  parentProp3.setValue("parentVal3");
  parentOtherProperties.add(parentProp3);
  // create parent config modules
  ConfigurationModule parentConfigModule1 = createConfigurationModule("FOO", parentFooProperties);
  ConfigurationModule parentConfigModule2 = createConfigurationModule("BAR", parentBarProperties);
  ConfigurationModule parentConfigModule3 = createConfigurationModule("OTHER", parentOtherProperties);
  Collection<ConfigurationModule> parentModules = new ArrayList<ConfigurationModule>();
  parentModules.add(parentConfigModule1);
  parentModules.add(parentConfigModule2);
  parentModules.add(parentConfigModule3);
  // create service modules
  ServiceModule child = createServiceModule(info, childModules);
  ServiceModule parent = createServiceModule(parentInfo, parentModules);
  // resolve child with parent
  resolveService(child, parent);
  // assertions
  List<PropertyInfo> mergedProperties = child.getModuleInfo().getProperties();
  assertEquals(4, mergedProperties.size());
  Map<String, PropertyInfo> mergedPropertyMap = new HashMap<String, PropertyInfo>();
  for (PropertyInfo prop : mergedProperties) {
    mergedPropertyMap.put(prop.getName(), prop);
  }
  // filename is null for all props because that is set in ConfigurationDirectory which is mocked
  assertEquals("childVal1", mergedPropertyMap.get("childName1").getValue());
  assertEquals("childVal2", mergedPropertyMap.get("childName2").getValue());
  assertEquals("parentVal1", mergedPropertyMap.get("parentName1").getValue());
  assertEquals("parentVal3", mergedPropertyMap.get("parentName3").getValue());
  Map<String, Map<String, Map<String, String>>> childAttributes = child.getModuleInfo().getConfigTypeAttributes();
  Map<String, Map<String, Map<String, String>>> parentAttributes = parent.getModuleInfo().getConfigTypeAttributes();
  assertEquals(3, childAttributes.size());
  assertAttributes(childAttributes.get("FOO"), Collections.<String, String>emptyMap());
  assertAttributes(childAttributes.get("BAR"), attributes);
  assertAttributes(childAttributes.get("OTHER"), Collections.<String, String>emptyMap());
  assertEquals(3, parentAttributes.size());
  assertAttributes(parentAttributes.get("FOO"), Collections.<String, String>emptyMap());
  assertAttributes(parentAttributes.get("BAR"), Collections.<String, String>emptyMap());
  assertAttributes(parentAttributes.get("OTHER"), Collections.<String, String>emptyMap());
}