@Test
  public void testResolve_CredentialStoreInfo() throws Exception {
    CredentialStoreInfo credentialStoreInfoChild = new CredentialStoreInfo(true /* supported */, false /* enabled */, true /*required*/);
    CredentialStoreInfo credentialStoreInfoParent = new CredentialStoreInfo(true /* supported */, true /* enabled */, false /*required*/);
    ServiceInfo childInfo = new ServiceInfo();
    ServiceInfo parentInfo = new ServiceInfo();
    ServiceModule service;

    // specified in child only, child wins
    childInfo.setCredentialStoreInfo(credentialStoreInfoChild);
    parentInfo.setCredentialStoreInfo(null);
    service = resolveService(childInfo, parentInfo);
    assertEquals(credentialStoreInfoChild.isSupported(), service.getModuleInfo().isCredentialStoreSupported());
    assertEquals(credentialStoreInfoChild.isEnabled(), service.getModuleInfo().isCredentialStoreEnabled());
    assertEquals(credentialStoreInfoChild.isRequired(), service.getModuleInfo().isCredentialStoreRequired());

    // specified in parent only, parent wins
    childInfo.setCredentialStoreInfo(null);
    parentInfo.setCredentialStoreInfo(credentialStoreInfoParent);
    service = resolveService(childInfo, parentInfo);
    assertEquals(credentialStoreInfoParent.isSupported(), service.getModuleInfo().isCredentialStoreSupported());
    assertEquals(credentialStoreInfoParent.isEnabled(), service.getModuleInfo().isCredentialStoreEnabled());
    assertEquals(credentialStoreInfoParent.isRequired(), service.getModuleInfo().isCredentialStoreRequired());

    // specified in both, child wins
    childInfo.setCredentialStoreInfo(credentialStoreInfoChild);
    parentInfo.setCredentialStoreInfo(credentialStoreInfoParent);
    service = resolveService(childInfo, parentInfo);
    assertEquals(credentialStoreInfoChild.isSupported(), service.getModuleInfo().isCredentialStoreSupported());
    assertEquals(credentialStoreInfoChild.isEnabled(), service.getModuleInfo().isCredentialStoreEnabled());
    assertEquals(credentialStoreInfoChild.isRequired(), service.getModuleInfo().isCredentialStoreRequired());
  }
Verify stack resolution for credential-store

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/stack/ServiceModuleTest.java