File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jooq Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,19 @@ void transactionProviderBacksOffOnExistingTransactionProvider() {
175175 .run ((context ) -> {
176176 TransactionProvider transactionProvider = context .getBean (TransactionProvider .class );
177177 assertThat (transactionProvider ).isInstanceOf (CustomTransactionProvider .class );
178+ DSLContext dsl = context .getBean (DSLContext .class );
179+ assertThat (dsl .configuration ().transactionProvider ()).isSameAs (transactionProvider );
180+ });
181+ }
182+
183+ @ Test
184+ void transactionProviderFromConfigurationCustomizerOverridesTransactionProviderBean () {
185+ this .contextRunner .withUserConfiguration (JooqDataSourceConfiguration .class , TxManagerConfiguration .class ,
186+ CustomTransactionProviderFromCustomizerConfiguration .class ).run ((context ) -> {
187+ TransactionProvider transactionProvider = context .getBean (TransactionProvider .class );
188+ assertThat (transactionProvider ).isInstanceOf (SpringTransactionProvider .class );
189+ DSLContext dsl = context .getBean (DSLContext .class );
190+ assertThat (dsl .configuration ().transactionProvider ()).isInstanceOf (CustomTransactionProvider .class );
178191 });
179192 }
180193
@@ -239,6 +252,16 @@ TransactionProvider transactionProvider() {
239252
240253 }
241254
255+ @ Configuration (proxyBeanMethods = false )
256+ static class CustomTransactionProviderFromCustomizerConfiguration {
257+
258+ @ Bean
259+ DefaultConfigurationCustomizer transactionProviderCustomizer () {
260+ return (configuration ) -> configuration .setTransactionProvider (new CustomTransactionProvider ());
261+ }
262+
263+ }
264+
242265 @ Configuration (proxyBeanMethods = false )
243266 static class TxManagerConfiguration {
244267
You can’t perform that action at this time.
0 commit comments