Skip to content

Align TransactionManagementConfigurer support in TestContext framework with production #24869

@friscoMad

Description

@friscoMad

Affects: Spring Framework 4.3.0+

When @Primary support was added for spring-test in 677a321, the lookup was added before TransactionManagementConfigurer lookup and not after as it should have been, given that TransactionManagementConfigurer should take higher precedence. In fact maybe it should be the first check even before the beansOfTypeIncludingAncestors lookup as the configurer can construct a TransactionManager that is not a registered bean (a registered bean could be in the context that is not the one that the configurer will return).

Steps to reproduce

Configure a context with a @Primary TransactionManager and a TransactionManagementConfigurer.

Current result

Test uses the @Primary annotated bean.

Expected result

Test should use the bean provided by TransactionManagementConfigurer.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions