### Question:
HbaseCloudStorageServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { List<ApiClusterTemplateConfig> hbaseConfigs = new ArrayList<>(1); ConfigUtils.getStorageLocationForServiceProperty(source, HBASE_ROOT_DIR) .ifPresent(location -> hbaseConfigs.add(config(HBASE_ROOT_DIR_TEMPLATE_PARAM, location.getValue()))); return hbaseConfigs; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes(); @Override boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source);  }### Answer:
@Test public void testGetHbaseStorageServiceConfigsWhenAttachedCluster() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, false); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(1, serviceConfigs.size()); assertEquals("hdfs_rootdir", serviceConfigs.get(0).getName()); assertEquals("s3a: }
@Test public void testGetHbaseStorageServiceConfigsWhenDataLake721() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.1"); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(1, serviceConfigs.size()); assertEquals("hdfs_rootdir", serviceConfigs.get(0).getName()); assertEquals("s3a: }
@Test public void testGetHbaseStorageServiceConfigsWhenDataLake722() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.2"); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(1, serviceConfigs.size()); assertEquals("hdfs_rootdir", serviceConfigs.get(0).getName()); assertEquals("s3a: }
@Test public void testGetHbaseServiceConfigsWhenNoStorageConfiguredWithAttachedCluster() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(false, false); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(0, serviceConfigs.size()); }
@Test public void testGetHbaseServiceConfigsWhenNoStorageConfiguredWithDataLake() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(false, true); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); List<ApiClusterTemplateConfig> serviceConfigs = underTest.getServiceConfigs(cmTemplateProcessor, preparationObject); assertEquals(0, serviceConfigs.size()); }