DataSourceParameterConverter { public static Map<String, DataSourceParameter> getDataSourceParameterMap(final Map<String, DataSourceConfiguration> dataSourceConfigurationMap) { return dataSourceConfigurationMap.entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> createDataSourceParameter(entry.getValue()), (oldValue, currentValue) -> oldValue, 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 assertGetDataSourceParameterMap() { Map<String, DataSourceConfiguration> dataSourceConfigurationMap = new HashMap<>(2, 1); DataSourceConfiguration dataSourceConfiguration0 = new DataSourceConfiguration(HikariDataSource.class.getName()); dataSourceConfiguration0.getProps().put("url", "jdbc:mysql: dataSourceConfigurationMap.put("ds_0", dataSourceConfiguration0); DataSourceConfiguration dataSourceConfiguration1 = new DataSourceConfiguration(HikariDataSource.class.getName()); dataSourceConfiguration1.getProps().put("jdbcUrl", "jdbc:mysql: dataSourceConfigurationMap.put("ds_1", dataSourceConfiguration1); Map<String, DataSourceParameter> actual = DataSourceParameterConverter.getDataSourceParameterMap(dataSourceConfigurationMap); assertThat(actual.size(), is(2)); assertThat(actual.get("ds_0").getUrl(), is("jdbc:mysql: assertThat(actual.get("ds_1").getUrl(), is("jdbc:mysql: }