### Question:
HueConfigProvider extends AbstractRdsRoleConfigProvider { @Override public List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source) { List<ApiClusterTemplateConfig> result = new ArrayList<>(); result.add(new ApiClusterTemplateConfig().name("database_host").variable(HUE_DATABASE_HOST)); result.add(new ApiClusterTemplateConfig().name("database_port").variable(HUE_DATABASE_PORT)); result.add(new ApiClusterTemplateConfig().name("database_name").variable(HUE_DATABASE_NAME)); result.add(new ApiClusterTemplateConfig().name("database_type").variable(HUE_HUE_DATABASE_TYPE)); result.add(new ApiClusterTemplateConfig().name("database_user").variable(HUE_HUE_DATABASE_USER)); result.add(new ApiClusterTemplateConfig().name("database_password").variable(HUE_DATABASE_PASSWORD)); String cdhVersion = getCdhVersionString(source); if (!isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_1_0)) { configureKnoxProxyHostsServiceConfigSafetyValve(source, result); } return result; }  @Override List<ApiClusterTemplateConfig> getServiceConfigs(CmTemplateProcessor templateProcessor, TemplatePreparationObject source); @Override List<ApiClusterTemplateVariable> getServiceConfigVariables(TemplatePreparationObject source); @Override String getServiceType(); @Override List<String> getRoleTypes();  }### Answer:
@Test public void getServiceConfigs() { BlueprintView blueprintView = getMockBlueprintView("7.0.2", "7.0.2"); TemplatePreparationObject tpo = new Builder().withBlueprintView(blueprintView).build(); List<ApiClusterTemplateConfig> result = underTest.getServiceConfigs(null, tpo); Map<String, String> paramToVariable = result.stream().collect(Collectors.toMap(ApiClusterTemplateConfig::getName, ApiClusterTemplateConfig::getVariable)); assertThat(paramToVariable).containsOnly( new SimpleEntry<>("database_host", "hue-hue_database_host"), new SimpleEntry<>("database_port", "hue-hue_database_port"), new SimpleEntry<>("database_name", "hue-hue_database_name"), new SimpleEntry<>("database_type", "hue-hue_database_type"), new SimpleEntry<>("database_user", "hue-hue_database_user"), new SimpleEntry<>("database_password", "hue-hue_database_password") ); }
@Test public void getServiceConfigsWhenKnoxConfiguredToExternalDomain() { BlueprintView blueprintView = getMockBlueprintView("7.0.2", "7.0.2"); GeneralClusterConfigs generalClusterConfigs = new GeneralClusterConfigs(); generalClusterConfigs.setExternalFQDN("myaddress.cloudera.site"); generalClusterConfigs.setKnoxUserFacingCertConfigured(true); generalClusterConfigs.setPrimaryGatewayInstanceDiscoveryFQDN(Optional.of("private-gateway.cloudera.site")); TemplatePreparationObject tpo = new Builder() .withGeneralClusterConfigs(generalClusterConfigs) .withBlueprintView(blueprintView) .withGateway(new Gateway(), "", new HashSet<>()) .build(); List<ApiClusterTemplateConfig> result = underTest.getServiceConfigs(null, tpo); Map<String, String> paramToVariable = result.stream().collect(Collectors.toMap(ApiClusterTemplateConfig::getName, ApiClusterTemplateConfig::getVariable)); assertThat(paramToVariable).containsOnly( new SimpleEntry<>("database_host", "hue-hue_database_host"), new SimpleEntry<>("database_port", "hue-hue_database_port"), new SimpleEntry<>("database_name", "hue-hue_database_name"), new SimpleEntry<>("database_type", "hue-hue_database_type"), new SimpleEntry<>("database_user", "hue-hue_database_user"), new SimpleEntry<>("database_password", "hue-hue_database_password"), new SimpleEntry<>("hue_service_safety_valve", "hue-hue_service_safety_valve") ); }