Skip to content

Document workaround for @PersistenceContext and @PersistenceUnit in test classes in AOT #31442

@sbrannen

Description

@sbrannen

Overview

While running JPA tests 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 AbstractEjbTxDaoTestNGTests is not injected when running in AOT mode.

@PersistenceContext
protected EntityManager em;

Related Issues

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions