Make devtools set spring.messages.reloadable=true

Update `DevToolsPropertyDefaultsPostProcessor` to automatically set
the recently introduced `spring.messages.reloadable` property to
`true`.

Closes gh-14699
pull/14353/merge
Phillip Webb 6 years ago
parent 01b8667dd7
commit 1d8e4a8f5c

@ -73,6 +73,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro
properties.put("server.error.include-stacktrace", "ALWAYS");
properties.put("server.servlet.jsp.init-parameters.development", "true");
properties.put("spring.reactor.stacktrace-mode.enabled", "true");
properties.put("spring.messages.reloadable", "true");
PROPERTIES = Collections.unmodifiableMap(properties);
}

@ -114,6 +114,17 @@ public class DevToolPropertiesIntegrationTests {
.isEqualTo(ErrorProperties.IncludeStacktrace.ALWAYS.toString());
}
@Test
public void postProcessEnablesMessageSourceReloadProperty() {
SpringApplication application = new SpringApplication(TestConfiguration.class);
application.setWebApplicationType(WebApplicationType.NONE);
this.context = application.run();
ConfigurableEnvironment environment = this.context.getEnvironment();
Boolean property = environment.getProperty("spring.messages.reloadable",
Boolean.class);
assertThat(property).isTrue();
}
@Configuration
static class TestConfiguration {

Loading…
Cancel
Save