I have an interceptor annotated only with @AroundInvoke, which is declared on a method of the @Stateless EJB under test with @Interceptors.
When I run the test the interceptor is called, to my surprise without it being included in @AdditionalClasses.
Now I would like to mock the interceptor like so:
@Produces
@ProducesAlternative
@Mock
private MyInterceptor interceptor;
but the real implementation is being called.
I tried to annotate the interceptor with @Interceptor and add it to @AdditionalClasses but that did not help.
The beans.xml is empty.
Injection of mocked beans works fine.
What could I be missing?
Torsten