@Test public void getServiceConfigVariables() { BlueprintView blueprintView = getMockBlueprintView("7.2.0", "7.1.0"); RDSConfig rdsConfig = new RDSConfig(); rdsConfig.setType(HUE); rdsConfig.setConnectionURL(String.format("jdbc:%s: rdsConfig.setConnectionUserName(USER_NAME); rdsConfig.setConnectionPassword(PASSWORD); TemplatePreparationObject tpo = new Builder() .withRdsConfigs(Set.of(rdsConfig)) .withBlueprintView(blueprintView) .build(); List<ApiClusterTemplateVariable> result = underTest.getServiceConfigVariables(tpo); Map<String, String> paramToVariable = result.stream().collect(Collectors.toMap(ApiClusterTemplateVariable::getName, ApiClusterTemplateVariable::getValue)); assertThat(paramToVariable).containsOnly( new SimpleEntry<>("hue-hue_database_host", HOST), new SimpleEntry<>("hue-hue_database_port", PORT), new SimpleEntry<>("hue-hue_database_name", DB_NAME), new SimpleEntry<>("hue-hue_database_type", DB_PROVIDER), new SimpleEntry<>("hue-hue_database_user", USER_NAME), new SimpleEntry<>("hue-hue_database_password", PASSWORD)); }
@Override public List<ApiClusterTemplateVariable> getServiceConfigVariables(TemplatePreparationObject source) { List<ApiClusterTemplateVariable> result = new ArrayList<>(); RdsView hueRdsView = getRdsView(source); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_HOST).value(hueRdsView.getHost())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PORT).value(hueRdsView.getPort())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_NAME).value(hueRdsView.getDatabaseName())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_TYPE).value(hueRdsView.getSubprotocol())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_USER).value(hueRdsView.getConnectionUserName())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PASSWORD).value(hueRdsView.getConnectionPassword())); configureKnoxProxyHostsConfigVariables(source, result); return result; }
HueConfigProvider extends AbstractRdsRoleConfigProvider { @Override public List<ApiClusterTemplateVariable> getServiceConfigVariables(TemplatePreparationObject source) { List<ApiClusterTemplateVariable> result = new ArrayList<>(); RdsView hueRdsView = getRdsView(source); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_HOST).value(hueRdsView.getHost())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PORT).value(hueRdsView.getPort())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_NAME).value(hueRdsView.getDatabaseName())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_TYPE).value(hueRdsView.getSubprotocol())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_USER).value(hueRdsView.getConnectionUserName())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PASSWORD).value(hueRdsView.getConnectionPassword())); configureKnoxProxyHostsConfigVariables(source, result); return result; } }
HueConfigProvider extends AbstractRdsRoleConfigProvider { @Override public List<ApiClusterTemplateVariable> getServiceConfigVariables(TemplatePreparationObject source) { List<ApiClusterTemplateVariable> result = new ArrayList<>(); RdsView hueRdsView = getRdsView(source); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_HOST).value(hueRdsView.getHost())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PORT).value(hueRdsView.getPort())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_NAME).value(hueRdsView.getDatabaseName())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_TYPE).value(hueRdsView.getSubprotocol())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_USER).value(hueRdsView.getConnectionUserName())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PASSWORD).value(hueRdsView.getConnectionPassword())); configureKnoxProxyHostsConfigVariables(source, result); return result; }  }
HueConfigProvider extends AbstractRdsRoleConfigProvider { @Override public List<ApiClusterTemplateVariable> getServiceConfigVariables(TemplatePreparationObject source) { List<ApiClusterTemplateVariable> result = new ArrayList<>(); RdsView hueRdsView = getRdsView(source); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_HOST).value(hueRdsView.getHost())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PORT).value(hueRdsView.getPort())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_NAME).value(hueRdsView.getDatabaseName())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_TYPE).value(hueRdsView.getSubprotocol())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_USER).value(hueRdsView.getConnectionUserName())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PASSWORD).value(hueRdsView.getConnectionPassword())); configureKnoxProxyHostsConfigVariables(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<ApiClusterTemplateVariable> getServiceConfigVariables(TemplatePreparationObject source) { List<ApiClusterTemplateVariable> result = new ArrayList<>(); RdsView hueRdsView = getRdsView(source); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_HOST).value(hueRdsView.getHost())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PORT).value(hueRdsView.getPort())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_NAME).value(hueRdsView.getDatabaseName())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_TYPE).value(hueRdsView.getSubprotocol())); result.add(new ApiClusterTemplateVariable().name(HUE_HUE_DATABASE_USER).value(hueRdsView.getConnectionUserName())); result.add(new ApiClusterTemplateVariable().name(HUE_DATABASE_PASSWORD).value(hueRdsView.getConnectionPassword())); configureKnoxProxyHostsConfigVariables(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();  }