Skip to content

Commit 16b126a

Browse files
committed
Merge branch '2.7.x' into 3.0.x
Closes gh-34799
2 parents c37ff8d + c9e69b1 commit 16b126a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private Config cassandraConfiguration(CassandraProperties properties) {
135135
config = config.withFallback(loadConfig(properties.getConfig()));
136136
}
137137
config = config.withFallback(SPRING_BOOT_DEFAULTS);
138-
config = config.withFallback(ConfigFactory.defaultReference());
138+
config = config.withFallback(ConfigFactory.defaultReferenceUnresolved());
139139
return config.resolve();
140140
}
141141

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cassandra/CassandraAutoConfigurationTests.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,18 @@ void driverConfigLoaderWithConfigOverridesDefaults() {
298298
});
299299
}
300300

301+
@Test
302+
void placeholdersInReferenceConfAreResolvedAgainstConfigDerivedFromSpringCassandraProperties() {
303+
this.contextRunner.withPropertyValues("spring.cassandra.request.timeout=60s").run((context) -> {
304+
DriverExecutionProfile actual = context.getBean(DriverConfigLoader.class)
305+
.getInitialConfig()
306+
.getDefaultProfile();
307+
assertThat(actual.getDuration(DefaultDriverOption.REQUEST_TIMEOUT)).isEqualTo(Duration.ofSeconds(60));
308+
assertThat(actual.getDuration(DefaultDriverOption.METADATA_SCHEMA_REQUEST_TIMEOUT))
309+
.isEqualTo(Duration.ofSeconds(60));
310+
});
311+
}
312+
301313
@Test
302314
void driverConfigLoaderWithConfigCreateProfiles() {
303315
String configLocation = "org/springframework/boot/autoconfigure/cassandra/profiles.conf";

0 commit comments

Comments
 (0)