Merge pull request #24867 from izeye

* pr/24867:
  Fix property name for spring.dao.exceptiontranslation.enabled

Closes gh-24867
pull/24986/head
Stephane Nicoll 4 years ago
commit 819809849f

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

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

Loading…
Cancel
Save