|
|
|
|
@ -25,6 +25,7 @@ import org.junit.jupiter.api.Test;
@@ -25,6 +25,7 @@ import org.junit.jupiter.api.Test;
|
|
|
|
|
import org.springframework.boot.autoconfigure.AutoConfigurations; |
|
|
|
|
import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration; |
|
|
|
|
import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizationAutoConfiguration; |
|
|
|
|
import org.springframework.boot.test.context.FilteredClassLoader; |
|
|
|
|
import org.springframework.boot.test.context.runner.ApplicationContextRunner; |
|
|
|
|
import org.springframework.jdbc.datasource.DataSourceTransactionManager; |
|
|
|
|
import org.springframework.jdbc.support.JdbcTransactionManager; |
|
|
|
|
@ -40,6 +41,7 @@ import static org.mockito.Mockito.mock;
@@ -40,6 +41,7 @@ import static org.mockito.Mockito.mock;
|
|
|
|
|
* @author Stephane Nicoll |
|
|
|
|
* @author Kazuki Shimizu |
|
|
|
|
* @author Davin Byeon |
|
|
|
|
* @author Moritz Halbritter |
|
|
|
|
*/ |
|
|
|
|
class DataSourceTransactionManagerAutoConfigurationTests { |
|
|
|
|
|
|
|
|
|
@ -124,4 +126,10 @@ class DataSourceTransactionManagerAutoConfigurationTests {
@@ -124,4 +126,10 @@ class DataSourceTransactionManagerAutoConfigurationTests {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
void shouldNotUseDataSourcePropertiesIfDataSourceIsNotOnTheClasspath() { |
|
|
|
|
this.contextRunner.withClassLoader(new FilteredClassLoader(DataSource.class)) |
|
|
|
|
.run((context) -> assertThat(context).doesNotHaveBean(DataSourceProperties.class)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|