|
|
@ -38,6 +38,7 @@ import static org.mockito.Mockito.mock;
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Dave Syer
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
* @author Kazuki Shimizu
|
|
|
|
* @author Kazuki Shimizu
|
|
|
|
|
|
|
|
* @author Davin Byeon
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class DataSourceTransactionManagerAutoConfigurationTests {
|
|
|
|
class DataSourceTransactionManagerAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
@ -76,7 +77,7 @@ class DataSourceTransactionManagerAutoConfigurationTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void transactionManagerWithExistingTransactionManagerIsNotOverridden() {
|
|
|
|
void transactionManagerWithExistingTransactionManagerIsNotOverridden() {
|
|
|
|
this.contextRunner
|
|
|
|
this.contextRunner.withConfiguration(AutoConfigurations.of(DataSourceAutoConfiguration.class))
|
|
|
|
.withBean("myTransactionManager", TransactionManager.class, () -> mock(TransactionManager.class))
|
|
|
|
.withBean("myTransactionManager", TransactionManager.class, () -> mock(TransactionManager.class))
|
|
|
|
.run((context) -> assertThat(context).hasSingleBean(TransactionManager.class)
|
|
|
|
.run((context) -> assertThat(context).hasSingleBean(TransactionManager.class)
|
|
|
|
.hasBean("myTransactionManager"));
|
|
|
|
.hasBean("myTransactionManager"));
|
|
|
|