@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") ); }
@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; }
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; } }
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; }  }
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(); }
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();  }