Skip to content

Some sliced tests that import TransactionAutoConfiguration do not import TransactionManagerCustomizationAutoConfiguration #49716

@ZIRAKrezovic

Description

@ZIRAKrezovic

As the title says, if you use @DataJpaTest test slice, and expect an TransactionExecutionListener to be used at runtime, it won't work as the mentioned auto configuration class is not included within the test slice.

I can workaround it using

import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizationAutoConfiguration;

@ImportAutoConfiguration({
    TransactionManagerCustomizationAutoConfiguration.class
})

Would be nice if it was handled by the slice itself.

Metadata

Metadata

Assignees

Labels

status: team-onlyAn issue that's best handled directly by the team rather than a community contribution.type: bugA general bug

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions