[ 
https://issues.apache.org/jira/browse/DELTASPIKE-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14159109#comment-14159109
 ] 

Gerhard Petracek commented on DELTASPIKE-736:
---------------------------------------------

not sure what you mean.

#1 you fixed the issue in owb (thx for that)
#2 we don't wrap beans already which can't be mocked (maybe we need to cover 
more here)
#3 there is already MockFilter#isMockedImplementationSupported which can be 
used to skip the wrapper for all beans you don't like to mock (if there is an 
issue)
#4 users don't have to care if there is a wrapper or not if it works 
technically (if something doesn't work: see #2 and #3)

it's really just about white- vs blacklisting. and that's more a matter of 
taste - like the discussion "configuration by exception" vs. "config everything 
explicitly". with blacklisting we are closer to the ee-style. since we have it 
already and you can work with it (if you need to), i wouldn't confuse users by 
adding/changing something.

> 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
>
> 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)

Reply via email to