-
I have a Is it possible to use a CDI interceptor on a test class that also works for its inner |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
-
No. The interceptor only works because the test class is treated as a bean and the test instance is obtained from the CDI container. This clearly is not the case for |
Beta Was this translation helpful? Give feedback.
I don't think there is, at least in terms of CDI interception. Nested classes cannot become beans; the biggest issue is the way they are instantiated and the affect it would have in terms of bean (re)creation and proxyability.
If you really need CDI interception of test instances, avoid using
@Nested
and organize tests differently.