Skip to content

Commit 21db142

Browse files
izeyesnicoll
authored andcommitted
Fix property name for spring.dao.exceptiontranslation.enabled
See gh-24867
1 parent 52ca841 commit 21db142

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ DataSourceTransactionManager transactionManager(Environment environment, DataSou
6464
}
6565

6666
private DataSourceTransactionManager createTransactionManager(Environment environment, DataSource dataSource) {
67-
return environment.getProperty("spring.dao.exceptiontranslation.enable", Boolean.class, Boolean.TRUE)
67+
return environment.getProperty("spring.dao.exceptiontranslation.enabled", Boolean.class, Boolean.TRUE)
6868
? new JdbcTransactionManager(dataSource) : new DataSourceTransactionManager(dataSource);
6969
}
7070

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceTransactionManagerAutoConfigurationTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ void transactionManagerWithExistingTransactionManagerIsNotOverridden() {
8787
@Test // gh-24321
8888
void transactionManagerWithDaoExceptionTranslationDisabled() {
8989
this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
90-
.withPropertyValues("spring.dao.exceptiontranslation.enable=false")
90+
.withPropertyValues("spring.dao.exceptiontranslation.enabled=false")
9191
.run((context) -> assertThat(context.getBean(TransactionManager.class))
9292
.isExactlyInstanceOf(DataSourceTransactionManager.class));
9393
}
9494

9595
@Test // gh-24321
9696
void transactionManagerWithDaoExceptionTranslationEnabled() {
9797
this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
98-
.withPropertyValues("spring.dao.exceptiontranslation.enable=true")
98+
.withPropertyValues("spring.dao.exceptiontranslation.enabled=true")
9999
.run((context) -> assertThat(context.getBean(TransactionManager.class))
100100
.isExactlyInstanceOf(JdbcTransactionManager.class));
101101
}

0 commit comments

Comments
 (0)