Skip to content

Commit

Permalink
Merge branch '2.7.x' into 3.0.x
Browse files Browse the repository at this point in the history
Closes gh-34799
  • Loading branch information
wilkinsona committed Mar 28, 2023
2 parents c37ff8d + c9e69b1 commit 16b126a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private Config cassandraConfiguration(CassandraProperties properties) {
config = config.withFallback(loadConfig(properties.getConfig()));
}
config = config.withFallback(SPRING_BOOT_DEFAULTS);
config = config.withFallback(ConfigFactory.defaultReference());
config = config.withFallback(ConfigFactory.defaultReferenceUnresolved());
return config.resolve();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,18 @@ void driverConfigLoaderWithConfigOverridesDefaults() {
});
}

@Test
void placeholdersInReferenceConfAreResolvedAgainstConfigDerivedFromSpringCassandraProperties() {
this.contextRunner.withPropertyValues("spring.cassandra.request.timeout=60s").run((context) -> {
DriverExecutionProfile actual = context.getBean(DriverConfigLoader.class)
.getInitialConfig()
.getDefaultProfile();
assertThat(actual.getDuration(DefaultDriverOption.REQUEST_TIMEOUT)).isEqualTo(Duration.ofSeconds(60));
assertThat(actual.getDuration(DefaultDriverOption.METADATA_SCHEMA_REQUEST_TIMEOUT))
.isEqualTo(Duration.ofSeconds(60));
});
}

@Test
void driverConfigLoaderWithConfigCreateProfiles() {
String configLocation = "org/springframework/boot/autoconfigure/cassandra/profiles.conf";
Expand Down

0 comments on commit 16b126a

Please sign in to comment.