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() {
175
175
.run ((context ) -> {
176
176
TransactionProvider transactionProvider = context .getBean (TransactionProvider .class );
177
177
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 );
178
191
});
179
192
}
180
193
@@ -239,6 +252,16 @@ TransactionProvider transactionProvider() {
239
252
240
253
}
241
254
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
+
242
265
@ Configuration (proxyBeanMethods = false )
243
266
static class TxManagerConfiguration {
244
267
You can’t perform that action at this time.
0 commit comments