### Question:
HiveMetastoreCloudStorageServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { List<ApiClusterTemplateConfig> hmsConfigs = new ArrayList<>(2); ConfigUtils.getStorageLocationForServiceProperty(source, HMS_METASTORE_DIR) .ifPresent(location -> hmsConfigs.add(config(HMS_METASTORE_DIR_TEMPLATE_PARAM, location.getValue()))); ConfigUtils.getStorageLocationForServiceProperty(source, HMS_METASTORE_EXTERNAL_DIR) .ifPresent(location -> hmsConfigs.add(config(HMS_METASTORE_EXTERNAL_DIR_TEMPLATE_PARAM, location.getValue()))); ConfigUtils.getStorageLocationForServiceProperty(source, HMS_METASTORE_REPLICA_DIR_TEMPLATE_LOCATION) .ifPresent(location -> hmsConfigs.add(config(HMS_METASTORE_REPLICA_DIR, location.getValue()))); return hmsConfigs; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source); static final String HIVE_SERVICE_CONFIG_SAFETY_VALVE; static final String HMS_METASTORE_DIR; static final String HMS_METASTORE_EXTERNAL_DIR; static final String HMS_METASTORE_REPLICA_DIR_TEMPLATE_LOCATION; static final String HMS_METASTORE_REPLICA_DIR; static final String HMS_METASTORE_DIR_TEMPLATE_PARAM; static final String HMS_METASTORE_EXTERNAL_DIR_TEMPLATE_PARAM; }### Answer:
@Test public void testGetHMSStorageServiceConfigs() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(3, serviceConfigs.size()); assertEquals("hive_warehouse_directory", serviceConfigs.get(0).getName()); assertEquals("s3a: assertEquals("hive_warehouse_external_directory", serviceConfigs.get(1).getName()); assertEquals("s3a: assertEquals("hive_repl_replica_functions_root_dir", serviceConfigs.get(2).getName()); assertEquals("s3a: }
@Test public void testGetHMSStorageServiceConfigsWhenNoStorageConfigured() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(false); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(0, serviceConfigs.size()); }