[ https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14159124#comment-14159124 ]
Romain Manni-Bucau commented on DELTASPIKE-736: ----------------------------------------------- [~gpetracek] I agree it is black vs white list but since it is something which breaks easily containers and which can't work on most of "old" ones I'm for white list. Then the log should be rework to not pollute as much as today. Finally last point is it is better to ensure you know you mock something and activate it in this case cause by default you suppose you mock all beans (and mocking is not testing most of the time so it shouldn't be a default). > MockAwareInjectionTargetWrapper breaks interceptors in unit tests > ----------------------------------------------------------------- > > Key: DELTASPIKE-736 > URL: https://issues.apache.org/jira/browse/DELTASPIKE-736 > Project: DeltaSpike > Issue Type: Bug > Components: TestControl > Affects Versions: 1.0.3 > Environment: OpenWebBeans 1.2.6 > Reporter: Ronald Steininger > Attachments: ds-736-demo.tgz > > > The automatic usage of MockAwareInjectionTargetWrapper breaks method-level > interceptors under OWB: > org.apache.webbeans.config.BeansDeployer#validate creates the interceptor > stack of all beans while validating the deployment (Line 474). This code > depends on owbBean.getProducer() returning an AbstractProducer (Line 462). > TestControl replaces that AbstractProducer in some circumstances with an > instance of MockAwareInjectionTargetWrapper, completely deactivating the > if-branch which would active the interceptors. > It seems that, depending where the interceptor binding is defined on the > intercepted bean, interceptors work or don't work: using the annotation on > the class level results in getProducer returning a AbstractProducer -> > interceptors work. Defining interceptors only on methods shows the broken > behaviour described here. -- This message was sent by Atlassian JIRA (v6.3.4#6332)