This content has been marked as final.
Show 2 replies
-
1. Re: Use @EJB in helper class
aslak May 10, 2011 11:27 AM (in response to qtrin)Only the TestClass itself is managed by Arquillian and is the only one that will be injected.
You would need to have the TestClass extend the Helper classes or similar for them to be targets for injection.
-
2. Use @EJB in helper class
ronny.fraunhofer May 13, 2011 2:41 AM (in response to qtrin)I had the same problem an created my own Testenricher.
In my testcase the helper-class-member is annotated by my own annotation, lets say @Enrich.
The Testenricher is nearlly similar to the EJBTestEnricher and looks for test-case-members with the @Enrich-annotation.
If such a member is found, the enricher creates and injects the member (default constructor needed!) and then injects all members annotated with @EJB into the helper-class