DataSourceParameterConverter { public static Map<String, DataSourceParameter> getDataSourceParameterMapFromYamlConfiguration(final Map<String, YamlDataSourceParameter> dataSourceParameters) { return dataSourceParameters.entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> createDataSourceParameter(entry.getValue()), (oldVal, currVal) -> oldVal, LinkedHashMap::new)); }  static Map<String, DataSourceParameter> getDataSourceParameterMap(final Map<String, DataSourceConfiguration> dataSourceConfigurationMap); static Map<String, DataSourceParameter> getDataSourceParameterMapFromYamlConfiguration(final Map<String, YamlDataSourceParameter> dataSourceParameters); static Map<String, DataSourceConfiguration> getDataSourceConfigurationMap(final Map<String, DataSourceParameter> dataSourceParameterMap);  }
@Test public void assertGetDataSourceParameterMapFromYamlConfiguration() { Map<String, YamlDataSourceParameter> yamlDataSourceParameterMap = new HashMap<>(); YamlDataSourceParameter yamlDataSourceParameter0 = new YamlDataSourceParameter(); yamlDataSourceParameter0.setUrl("jdbc:mysql: setYamlDataSourceParameterPropertyWithoutUrl(yamlDataSourceParameter0); yamlDataSourceParameterMap.put("ds_0", yamlDataSourceParameter0); YamlDataSourceParameter yamlDataSourceParameter1 = new YamlDataSourceParameter(); yamlDataSourceParameter1.setUrl("jdbc:mysql: setYamlDataSourceParameterPropertyWithoutUrl(yamlDataSourceParameter1); yamlDataSourceParameterMap.put("ds_1", yamlDataSourceParameter1); Map<String, DataSourceParameter> actualDataSourceParameterMap = DataSourceParameterConverter.getDataSourceParameterMapFromYamlConfiguration(yamlDataSourceParameterMap); assertThat(actualDataSourceParameterMap.size(), is(2)); assertThat(actualDataSourceParameterMap.get("ds_0").getUrl(), is("jdbc:mysql: assertThat(actualDataSourceParameterMap.get("ds_1").getUrl(), is("jdbc:mysql: assertDataSourceParameter(actualDataSourceParameterMap.get("ds_0")); assertDataSourceParameter(actualDataSourceParameterMap.get("ds_1")); }