Skip to content

Commit 1d8e4a8

Browse files
committed
Make devtools set spring.messages.reloadable=true
Update `DevToolsPropertyDefaultsPostProcessor` to automatically set the recently introduced `spring.messages.reloadable` property to `true`. Closes spring-projectsgh-14699
1 parent 01b8667 commit 1d8e4a8

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java

+1
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
7373
properties.put("server.error.include-stacktrace", "ALWAYS");
7474
properties.put("server.servlet.jsp.init-parameters.development", "true");
7575
properties.put("spring.reactor.stacktrace-mode.enabled", "true");
76+
properties.put("spring.messages.reloadable", "true");
7677
PROPERTIES = Collections.unmodifiableMap(properties);
7778
}
7879

spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/env/DevToolPropertiesIntegrationTests.java

+11
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,17 @@ public void postProcessEnablesIncludeStackTraceProperty() {
114114
.isEqualTo(ErrorProperties.IncludeStacktrace.ALWAYS.toString());
115115
}
116116

117+
@Test
118+
public void postProcessEnablesMessageSourceReloadProperty() {
119+
SpringApplication application = new SpringApplication(TestConfiguration.class);
120+
application.setWebApplicationType(WebApplicationType.NONE);
121+
this.context = application.run();
122+
ConfigurableEnvironment environment = this.context.getEnvironment();
123+
Boolean property = environment.getProperty("spring.messages.reloadable",
124+
Boolean.class);
125+
assertThat(property).isTrue();
126+
}
127+
117128
@Configuration
118129
static class TestConfiguration {
119130

0 commit comments

Comments
 (0)