### Question:
AmbariServerConfigurationHandler extends RootServiceComponentConfigurationHandler { public Map<String, String> getConfigurationProperties(String categoryName) { Map<String, String> properties = null; List<AmbariConfigurationEntity> entities = ambariConfigurationDAO.findByCategory(categoryName); if (entities != null) { properties = new HashMap<>(); for (AmbariConfigurationEntity entity : entities) { properties.put(entity.getPropertyName(), entity.getPropertyValue()); } } return properties; } @Inject  AmbariServerConfigurationHandler(AmbariConfigurationDAO ambariConfigurationDAO, AmbariEventPublisher publisher, Configuration ambariConfiguration); @Override Map<String, RootServiceComponentConfiguration> getComponentConfigurations(String categoryName); @Override void removeComponentConfiguration(String categoryName); @Override void updateComponentCategory(String categoryName, Map<String, String> properties, boolean removePropertiesIfNotSpecified); @Override OperationResult performOperation(String categoryName, Map<String, String> properties,
                                          boolean mergeExistingProperties, String operation,
                                          Map<String, Object> operationParameters); Map<String, Map<String, String>> getConfigurations(); Map<String, String> getConfigurationProperties(String categoryName);  }### Answer:
@Test public void getConfigurationProperties() { List<AmbariConfigurationEntity> ssoEntities = new ArrayList<>(); ssoEntities.add(createEntity(SSO_CONFIGURATION.getCategoryName(), SSO_MANAGE_SERVICES.key(), "true")); ssoEntities.add(createEntity(SSO_CONFIGURATION.getCategoryName(), SSO_ENABLED_SERVICES.key(), "AMBARI,SERVICE1")); List<AmbariConfigurationEntity> allEntities = new ArrayList<>(ssoEntities); allEntities.add(createEntity(LDAP_CONFIGURATION.getCategoryName(), LDAP_ENABLED.key(), "true")); allEntities.add(createEntity(LDAP_CONFIGURATION.getCategoryName(), SERVER_HOST.key(), "host1")); AmbariConfigurationDAO ambariConfigurationDAO = createMock(AmbariConfigurationDAO.class); expect(ambariConfigurationDAO.findByCategory(SSO_CONFIGURATION.getCategoryName())).andReturn(ssoEntities).once(); expect(ambariConfigurationDAO.findByCategory("invalid category")).andReturn(null).once(); AmbariEventPublisher publisher = createMock(AmbariEventPublisher.class); Configuration configuration = createMock(Configuration.class); replayAll(); AmbariServerConfigurationHandler handler = new AmbariServerConfigurationHandler(ambariConfigurationDAO, publisher, configuration); Map<String, String> ssoConfigurations = handler.getConfigurationProperties(SSO_CONFIGURATION.getCategoryName()); Assert.assertEquals(2, ssoConfigurations.size()); Assert.assertTrue(ssoConfigurations.containsKey(SSO_ENABLED_SERVICES.key())); Assert.assertTrue(ssoConfigurations.containsKey(SSO_MANAGE_SERVICES.key())); Map<String, String> invalidConfigurations = handler.getConfigurationProperties("invalid category"); Assert.assertNull(invalidConfigurations); verifyAll(); }