Pull up setDisableMBeanRegistry

Issue: 44070
This commit is contained in:
Andy Wilkinson
2025-03-18 19:39:45 +00:00
committed by Phillip Webb
parent 8a1a5160c3
commit 232ed597a8
7 changed files with 20 additions and 51 deletions

View File

@@ -588,6 +588,15 @@ class TomcatWebServerFactoryCustomizerTests {
});
}
@Test
void enableMBeanRegistry() {
bind("server.tomcat.mbeanregistry.enabled=true");
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(0);
assertThat(factory.isDisableMBeanRegistry()).isTrue();
this.customizer.customize(factory);
assertThat(factory.isDisableMBeanRegistry()).isFalse();
}
private void bind(String... inlinedProperties) {
TestPropertySourceUtils.addInlinedPropertiesToEnvironment(this.environment, inlinedProperties);
Binder binder = new Binder(ConfigurationPropertySources.get(this.environment));