### Question:
HbaseCloudStorageServiceConfigProvider implements CmTemplateComponentConfigProvider { @Override public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); String actorCrn = INTERNAL_ACTOR_CRN; String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean sdxHbaseCloudStorageEnabled = entitlementService.sdxHbaseCloudStorageEnabled(actorCrn, accountId); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }  @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 testConfigurationNotNeededWhenDataLake721() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.1"); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); boolean configurationNeeded = underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject); assertFalse(configurationNeeded); }
@Test public void testConfigurationNeededWhenDatalake722() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.2"); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); boolean configurationNeeded = underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject); assertTrue(configurationNeeded); }
@Test public void testConfigurationNeededWhenDatalake723() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, true, "7.2.3"); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); boolean configurationNeeded = underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject); assertTrue(configurationNeeded); }
@Test public void testIsConfigurationNeededWhenAttachedCluster() { TemplatePreparationObject preparationObject = getTemplatePreparationObject(true, false); String inputJson = getBlueprintText("input/clouderamanager.bp"); CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(inputJson); boolean configurationNeeded = underTest.isConfigurationNeeded(cmTemplateProcessor, preparationObject); assertTrue(configurationNeeded); }