1 of 1 people found this helpful
I think this should help you to some extent https://github.com/arquillian/arquillian-showcase/tree/master/extensions/autodiscover
With regards to injecting mocked dao to the service - how about using @Inject instead of @EJB and write your own CDI producer (could be within the test class itself) which will create such a mocked repository?
As a side note I'm not really conviced if you really need mocks if you already have concrete implementations for your services and DAOs. This should be more for unit testing rather than integration testing where you anyway use container's infrastructure.
Hope that helps.
Personally, I rather tests my EJBs as "units" before I get into integration-tests such that are enabled by Arquillian.
Usually I mock all the dependencies of my EJB thus making it a real unit-test.
This is why I've created testfun-JEE which allows you to inject EJBs directly into your test class and it doesn't require any container.
testfun-JEE supports injection of EJBs, entity manager and some other common resources (such asJ DBC data source and context) - dependencies in injected EJBs are also being taken care by testfun-JEE.
One of the cool features of testfun-JEE is that if you add a variable member, which is an interface of an EJB, to your test class and this variable is annotated with @Mock (from Mockito), than this mock will replace the EJB everywhere.
See examples in https://github.com/michaelyaakoby/testfun