private ComponentModule resolveComponent(ComponentInfo info, ComponentInfo parentInfo) {
    info.setName("FOO");
    ComponentModule component = new ComponentModule(info);
    ComponentModule parentComponent = null;
    if (parentInfo != null) {
      parentInfo.setName("FOO");
      parentComponent = new ComponentModule(parentInfo);
    }

    component.resolve(parentComponent, Collections.emptyMap(), Collections.emptyMap(), Collections.emptyMap());

    return component;
  }
Test that versionAdvertised is resolved correctly.
ambari-server/src/test/java/org/apache/ambari/server/stack/ComponentModuleTest.java