Fix property name for spring.dao.exceptiontranslation.enabled
See gh-24867
This commit is contained in:
		
							parent
							
								
									52ca841a2e
								
							
						
					
					
						commit
						21db14227c
					
				| 
						 | 
					@ -64,7 +64,7 @@ public class DataSourceTransactionManagerAutoConfiguration {
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		private DataSourceTransactionManager createTransactionManager(Environment environment, DataSource dataSource) {
 | 
							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);
 | 
										? new JdbcTransactionManager(dataSource) : new DataSourceTransactionManager(dataSource);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -87,7 +87,7 @@ class DataSourceTransactionManagerAutoConfigurationTests {
 | 
				
			||||||
	@Test // gh-24321
 | 
						@Test // gh-24321
 | 
				
			||||||
	void transactionManagerWithDaoExceptionTranslationDisabled() {
 | 
						void transactionManagerWithDaoExceptionTranslationDisabled() {
 | 
				
			||||||
		this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
 | 
							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))
 | 
									.run((context) -> assertThat(context.getBean(TransactionManager.class))
 | 
				
			||||||
						.isExactlyInstanceOf(DataSourceTransactionManager.class));
 | 
											.isExactlyInstanceOf(DataSourceTransactionManager.class));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -95,7 +95,7 @@ class DataSourceTransactionManagerAutoConfigurationTests {
 | 
				
			||||||
	@Test // gh-24321
 | 
						@Test // gh-24321
 | 
				
			||||||
	void transactionManagerWithDaoExceptionTranslationEnabled() {
 | 
						void transactionManagerWithDaoExceptionTranslationEnabled() {
 | 
				
			||||||
		this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
 | 
							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))
 | 
									.run((context) -> assertThat(context.getBean(TransactionManager.class))
 | 
				
			||||||
						.isExactlyInstanceOf(JdbcTransactionManager.class));
 | 
											.isExactlyInstanceOf(JdbcTransactionManager.class));
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue