### Question:
AmbariServerSSOConfigurationHandler extends AmbariServerConfigurationHandler { public Set<String> getSSOEnabledServices() { Map<String, String> ssoProperties = getConfigurationProperties(SSO_CONFIGURATION.getCategoryName()); boolean manageSSOConfigurations = (ssoProperties != null) && "true".equalsIgnoreCase(ssoProperties.get(SSO_MANAGE_SERVICES.key())); String ssoEnabledServices = (manageSSOConfigurations) ? ssoProperties.get(SSO_ENABLED_SERVICES.key()) : null; if (StringUtils.isEmpty(ssoEnabledServices)) { return Collections.emptySet(); } else { return Arrays.stream(ssoEnabledServices.split(",")) .map(String::trim) .map(String::toUpperCase) .collect(Collectors.toSet()); } } @Inject  AmbariServerSSOConfigurationHandler(Clusters clusters, ConfigHelper configHelper,
                                             AmbariManagementController managementController,
                                             StackAdvisorHelper stackAdvisorHelper,
                                             AmbariConfigurationDAO ambariConfigurationDAO,
                                             AmbariEventPublisher publisher,
                                             Configuration ambariConfiguration); @Override void updateComponentCategory(String categoryName, Map<String, String> properties, boolean removePropertiesIfNotSpecified); Set<String> getSSOEnabledServices();  }### Answer:
@Test public void testCheckingIfSSOIsEnabledPerEachService() { Clusters clusters = createMock(Clusters.class); ConfigHelper configHelper = createMock(ConfigHelper.class); AmbariManagementController managementController = createMock(AmbariManagementController.class); StackAdvisorHelper stackAdvisorHelper = createMock(StackAdvisorHelper.class); AmbariEventPublisher publisher = createMock(AmbariEventPublisher.class); Configuration configuration = createMock(Configuration.class); List<AmbariConfigurationEntity> entities = new ArrayList<>(); AmbariConfigurationEntity entity; entity = new AmbariConfigurationEntity(); entity.setCategoryName(SSO_CONFIGURATION.getCategoryName()); entity.setPropertyName(SSO_MANAGE_SERVICES.key()); entity.setPropertyValue("true"); entities.add(entity); entity = new AmbariConfigurationEntity(); entity.setCategoryName(SSO_CONFIGURATION.getCategoryName()); entity.setPropertyName(SSO_ENABLED_SERVICES.key()); entity.setPropertyValue("SERVICE1,SERVICE2"); entities.add(entity); AmbariConfigurationDAO ambariConfigurationDAO = createMock(AmbariConfigurationDAO.class); expect(ambariConfigurationDAO.findByCategory(SSO_CONFIGURATION.getCategoryName())).andReturn(entities).anyTimes(); replayAll(); AmbariServerSSOConfigurationHandler handler = new AmbariServerSSOConfigurationHandler(clusters, configHelper, managementController, stackAdvisorHelper, ambariConfigurationDAO, publisher, configuration); Assert.assertTrue(handler.getSSOEnabledServices().contains("SERVICE1")); Assert.assertTrue(handler.getSSOEnabledServices().contains("SERVICE2")); Assert.assertFalse(handler.getSSOEnabledServices().contains("SERVICE3")); verifyAll(); }