Let cdi extension inject EntityManager
and EntityManagerFactory
not only into CDI Producer
#38
Labels
EntityManager
and EntityManagerFactory
not only into CDI Producer
#38
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
orEntityManagetFactory
directly (by using e.g.@PersistenceContext
annotation). In such situation the developer has to inject theEntityManaget
orEntityManagetFactory
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.The text was updated successfully, but these errors were encountered: