@Test
  public void testResolve_SingleSignOnInfo() throws Exception {
    SingleSignOnInfo singleSignOnInfoChild = new SingleSignOnInfo(false, null, true);
    SingleSignOnInfo singleSignOnInfoParent = new SingleSignOnInfo(true, "config-type/property_name", false);
    ServiceInfo childInfo = new ServiceInfo();
    ServiceInfo parentInfo = new ServiceInfo();
    ServiceModule serviceModule;
    ServiceInfo serviceInfo;

    // specified in child only, child wins
    childInfo.setSingleSignOnInfo(singleSignOnInfoChild);
    parentInfo.setSingleSignOnInfo(null);
    serviceModule = resolveService(childInfo, parentInfo);
    serviceInfo = serviceModule.getModuleInfo();
    assertEquals(singleSignOnInfoChild.isSupported(), serviceInfo.isSingleSignOnSupported());
    assertEquals(singleSignOnInfoChild.isSupported(), serviceInfo.getSingleSignOnInfo().isSupported());
    assertEquals(singleSignOnInfoChild.getSupported(), serviceInfo.getSingleSignOnInfo().getSupported());
    assertEquals(singleSignOnInfoChild.getEnabledConfiguration(), serviceInfo.getSingleSignOnInfo().getEnabledConfiguration());
    assertEquals(singleSignOnInfoChild.getSsoEnabledTest(), serviceInfo.getSingleSignOnInfo().getSsoEnabledTest());
    assertEquals(singleSignOnInfoChild.isKerberosRequired(), serviceInfo.isKerberosRequiredForSingleSignOnIntegration());
    assertEquals(singleSignOnInfoChild.isKerberosRequired(), serviceInfo.getSingleSignOnInfo().isKerberosRequired());

    // specified in parent only, parent wins
    childInfo.setSingleSignOnInfo(null);
    parentInfo.setSingleSignOnInfo(singleSignOnInfoParent);
    serviceModule = resolveService(childInfo, parentInfo);
    serviceInfo = serviceModule.getModuleInfo();
    assertEquals(singleSignOnInfoParent.isSupported(), serviceInfo.isSingleSignOnSupported());
    assertEquals(singleSignOnInfoParent.isSupported(), serviceInfo.getSingleSignOnInfo().isSupported());
    assertEquals(singleSignOnInfoParent.getSupported(), serviceInfo.getSingleSignOnInfo().getSupported());
    assertEquals(singleSignOnInfoParent.getEnabledConfiguration(), serviceInfo.getSingleSignOnInfo().getEnabledConfiguration());
    assertEquals(singleSignOnInfoParent.getSsoEnabledTest(), serviceInfo.getSingleSignOnInfo().getSsoEnabledTest());
    assertEquals(singleSignOnInfoParent.isKerberosRequired(), serviceInfo.isKerberosRequiredForSingleSignOnIntegration());
    assertEquals(singleSignOnInfoParent.isKerberosRequired(), serviceInfo.getSingleSignOnInfo().isKerberosRequired());

    // specified in both, child wins
    childInfo.setSingleSignOnInfo(singleSignOnInfoChild);
    parentInfo.setSingleSignOnInfo(singleSignOnInfoParent);
    serviceModule = resolveService(childInfo, parentInfo);
    serviceInfo = serviceModule.getModuleInfo();
    assertEquals(singleSignOnInfoChild.isSupported(), serviceInfo.isSingleSignOnSupported());
    assertEquals(singleSignOnInfoChild.isSupported(), serviceInfo.getSingleSignOnInfo().isSupported());
    assertEquals(singleSignOnInfoChild.getSupported(), serviceInfo.getSingleSignOnInfo().getSupported());
    assertEquals(singleSignOnInfoChild.getEnabledConfiguration(), serviceInfo.getSingleSignOnInfo().getEnabledConfiguration());
    assertEquals(singleSignOnInfoChild.getSsoEnabledTest(), serviceInfo.getSingleSignOnInfo().getSsoEnabledTest());
    assertEquals(singleSignOnInfoChild.isKerberosRequired(), serviceInfo.isKerberosRequiredForSingleSignOnIntegration());
    assertEquals(singleSignOnInfoChild.isKerberosRequired(), serviceInfo.getSingleSignOnInfo().isKerberosRequired());
  }
Verify stack resolution for single sign-on details

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