### Question:
KerberosServerAction extends AbstractServerAction { protected Map<String, String> getConfigurationProperties(String configType) throws AmbariException { if (StringUtils.isNotEmpty(configType)) { Cluster cluster = getCluster(); Config config = (cluster == null) ? null : cluster.getDesiredConfigByType(configType); Map<String, String> properties = (config == null) ? null : config.getProperties(); if (properties == null) { LOG.warn("The '{}' configuration data is not available:" + "\n\tcluster: {}" + "\n\tconfig: {}" + "\n\tproperties: null", configType, (cluster == null) ? "null" : "not null", (config == null) ? "null" : "not null"); } return properties; } else { return null; } }   static final String AUTHENTICATED_USER_NAME; static final String DATA_DIRECTORY; static final String DEFAULT_REALM; static final String SERVICE_COMPONENT_FILTER; static final String HOST_FILTER; static final String IDENTITY_FILTER; static final String KDC_TYPE; static final String UPDATE_CONFIGURATION_POLICY; static final String UPDATE_CONFIGURATION_NOTE; static final String DATA_DIRECTORY_PREFIX; static final String KEYTAB_CONTENT_BASE64; static final String OPERATION_TYPE; static final String INCLUDE_AMBARI_IDENTITY; static final String PRECONFIGURE_SERVICES; }### Answer:
@Test public void testGetConfigurationProperties() throws AmbariException { Config emptyConfig = createMock(Config.class); expect(emptyConfig.getProperties()).andReturn(Collections.emptyMap()).once(); Config missingPropertiesConfig = createMock(Config.class); expect(missingPropertiesConfig.getProperties()).andReturn(null).once(); expect(cluster.getDesiredConfigByType("invalid-type")).andReturn(null).once(); expect(cluster.getDesiredConfigByType("missing-properties-type")).andReturn(missingPropertiesConfig).once(); expect(cluster.getDesiredConfigByType("empty-type")).andReturn(emptyConfig).once(); replayAll(); Assert.assertNull(action.getConfigurationProperties(null)); Assert.assertNull(action.getConfigurationProperties("invalid-type")); Assert.assertNull(action.getConfigurationProperties("missing-properties-type")); Assert.assertEquals(Collections.emptyMap(), action.getConfigurationProperties("empty-type")); Assert.assertEquals(KERBEROS_ENV_PROPERTIES, action.getConfigurationProperties("kerberos-env")); verifyAll(); }