diff --git a/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/HibernateJpaAutoConfigurationTests.java b/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/HibernateJpaAutoConfigurationTests.java index 70a6ce36cb5..e3ee44b7d3e 100644 --- a/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/HibernateJpaAutoConfigurationTests.java +++ b/module/spring-boot-hibernate/src/test/java/org/springframework/boot/hibernate/autoconfigure/HibernateJpaAutoConfigurationTests.java @@ -737,6 +737,13 @@ class HibernateJpaAutoConfigurationTests { }); } + @Test + void beanContainerIsConfiguredByDefault() { + this.contextRunner.run((context) -> assertThat( + context.getBean(LocalContainerEntityManagerFactoryBean.class).getJpaPropertyMap()) + .containsKey(ManagedBeanSettings.BEAN_CONTAINER)); + } + @Test @WithResource(name = "city.sql", content = "INSERT INTO CITY (ID, NAME, STATE, COUNTRY, MAP) values (2000, 'Washington', 'DC', 'US', 'Google')") @@ -753,12 +760,6 @@ class HibernateJpaAutoConfigurationTests { }); } - @Test - void hibernatePropertiesCustomizerCanDisableBeanContainer() { - this.contextRunner.withUserConfiguration(DisableBeanContainerConfiguration.class) - .run((context) -> assertThat(context).doesNotHaveBean(City.class)); - } - @Test void vendorPropertiesWithEmbeddedDatabaseAndNoDdlProperty() { this.contextRunner.run(vendorProperties((vendorProperties) -> { @@ -1258,16 +1259,6 @@ class HibernateJpaAutoConfigurationTests { } - @Configuration(proxyBeanMethods = false) - static class DisableBeanContainerConfiguration { - - @Bean - HibernatePropertiesCustomizer disableBeanContainerHibernatePropertiesCustomizer() { - return (hibernateProperties) -> hibernateProperties.remove(ManagedBeanSettings.BEAN_CONTAINER); - } - - } - public static class TestJtaPlatform implements JtaPlatform { @Override