diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java index 2a491f6fb7..4fa98b3b7b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java @@ -64,7 +64,7 @@ public class DataSourceTransactionManagerAutoConfiguration { } private DataSourceTransactionManager createTransactionManager(Environment environment, DataSource dataSource) { - return environment.getProperty("spring.dao.exceptiontranslation.enable", Boolean.class, Boolean.TRUE) + return environment.getProperty("spring.dao.exceptiontranslation.enabled", Boolean.class, Boolean.TRUE) ? new JdbcTransactionManager(dataSource) : new DataSourceTransactionManager(dataSource); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java index 9bb993fede..9d9d42e25f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java @@ -87,7 +87,7 @@ class DataSourceTransactionManagerAutoConfigurationTests { @Test // gh-24321 void transactionManagerWithDaoExceptionTranslationDisabled() { this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class)) - .withPropertyValues("spring.dao.exceptiontranslation.enable=false") + .withPropertyValues("spring.dao.exceptiontranslation.enabled=false") .run((context) -> assertThat(context.getBean(TransactionManager.class)) .isExactlyInstanceOf(DataSourceTransactionManager.class)); } @@ -95,7 +95,7 @@ class DataSourceTransactionManagerAutoConfigurationTests { @Test // gh-24321 void transactionManagerWithDaoExceptionTranslationEnabled() { this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class)) - .withPropertyValues("spring.dao.exceptiontranslation.enable=true") + .withPropertyValues("spring.dao.exceptiontranslation.enabled=true") .run((context) -> assertThat(context.getBean(TransactionManager.class)) .isExactlyInstanceOf(JdbcTransactionManager.class)); }