Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions