Make ApplicationContextRunner immutable
Update `ApplicationContextRunner` so that it is totally immutable. Methods now return new instances rather than changing existing state. See gh-9875
This commit is contained in:
@@ -55,7 +55,9 @@ public class TestDatabaseAutoConfigurationTests {
|
||||
DataSource datasource = context.getBean(DataSource.class);
|
||||
JdbcTemplate jdbcTemplate = new JdbcTemplate(datasource);
|
||||
jdbcTemplate.execute("create table example (id int, name varchar);");
|
||||
this.contextRunner.run((secondContext) -> {
|
||||
this.contextRunner
|
||||
.withUserConfiguration(ExistingDataSourceConfiguration.class)
|
||||
.run((secondContext) -> {
|
||||
DataSource anotherDatasource = secondContext
|
||||
.getBean(DataSource.class);
|
||||
JdbcTemplate anotherJdbcTemplate = new JdbcTemplate(
|
||||
|
||||
Reference in New Issue
Block a user