2

I'm trying to create some integration tests for a j2ee application. The DAO layer requires a EJBContext so that it can call context.getUserTransaction() and utx.begin(). Using Guice i managed to get the EngityManager working. But the EJBContext is now null. Any ideas how to get this working.

@Resource
protected EJBContext context;
dinesh707
  • 10,694
  • 20
  • 74
  • 121
  • 1
    Mixing Injection frameworks is rarely a good idea ... I would try if CDIUtils or Arquillian are better matches for your test case. If you are just interested in "simulating" the injection, you also can try out needle4j, it uses reflection and auto-mocking to test ejb/cdi. – Jan Galinski Nov 24 '16 at 15:31

0 Answers0