Make devtools set spring.messages.reloadable=true

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

Closes gh-14699
This commit is contained in:
Phillip Webb 2018-10-05 13:59:26 -07:00
parent 01b8667dd7
commit 1d8e4a8f5c
2 changed files with 12 additions and 0 deletions

View File

@ -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);
}

View File

@ -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 {