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

Let cdi extension inject EntityManager and EntityManagerFactory not only into CDI Producer #38

Open
dadrus opened this issue Jun 16, 2018 · 1 comment

Comments

@dadrus
Copy link
Owner

dadrus commented Jun 16, 2018

As of today the jpa-unit cdi-extension handles CDI Producer only. That is, the jpa-unit cdi-extension cannot cope with situations, where the code under test injects EntityManaget or EntityManagetFactory directly (by using e.g. @PersistenceContext annotation). In such situation the developer has to inject the EntityManaget or EntityManagetFactory created by the jpa-unit by hand (e.g. by using a corresponding setter or reflection) in the test setup method. The jpa-unit cdi-extension is even not needed in such cases. It would be however helpful, if the cdi-extension would support such cases as well, thus eliminating the need of manual setup.

@trauchhaupt
Copy link

Is there any suggestion on how to get around that problem?

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

No branches or pull requests

2 participants