Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sbrannen opened this issue Oct 16, 2023 · 0 comments
Open
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) in: test Issues in the test module theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Oct 16, 2023

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

@sbrannen sbrannen added in: data Issues in data modules (jdbc, orm, oxm, tx) in: test Issues in the test module theme: aot An issue related to Ahead-of-time processing labels Oct 16, 2023
@sbrannen sbrannen added this to the 6.1.x milestone Oct 16, 2023
@snicoll snicoll added the type: enhancement A general enhancement label Oct 16, 2023
@bclozel bclozel modified the milestones: 6.1.x, 6.2.x Dec 18, 2023
@bclozel bclozel changed the title Support @PersistenceContext and @PersistenceUnit in test classes in AOT Support @PersistenceContext and @PersistenceUnit in test classes in AOT Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) in: test Issues in the test module theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants