Skip to content

Support @PersistenceContext and @PersistenceUnit in test classes in AOT #31442

Open
@sbrannen

Description

@sbrannen

Overview

While running tests such as JpaEntityListenerTests in the spring-test module in AOT mode, I noticed that we do not support dependency injection in an instance of a test class via @PersistenceContext and @PersistenceUnit.

For example, the following field in JpaEntityListenerTests is not injected when running in AOT mode.

@PersistenceContext
EntityManager entityManager;

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: dataIssues in data modules (jdbc, orm, oxm, tx)in: testIssues in the test moduletheme: aotAn issue related to Ahead-of-time processingtype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions