You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the TCK test InvocationContextTest#testGetTargetMethod() is incorrect in how it tests given behavior.
It currently relies on recursive interception to verify that InvocationContext#getTarget() returns the same instance of a bean. Namely the test invokes simpleBean.getId() and the around invoke interceptor then uses InvocationContext#getTarget() to obtain an instance of SimpleBean and invokes getId() again.
Correct me if I am wrong, but I couldn't find any evidence in CDI or Interceptors specs that would imply recursive interception is supported or even supposed to work. Now, I am not for or against that feature but if we want it, it should have it's own clear definition in either spec and its dedicated TCK test.
Note that the exact same test goal can be achieved without use of recursive interception (for instance a static field in the interceptor and comparing the two instances?). Therefore, we should be able to tweak the test to avoid recursive interception invocations without losing any coverage.
The text was updated successfully, but these errors were encountered:
I believe the TCK test
InvocationContextTest#testGetTargetMethod()
is incorrect in how it tests given behavior.It currently relies on recursive interception to verify that
InvocationContext#getTarget()
returns the same instance of a bean. Namely the test invokessimpleBean.getId()
and the around invoke interceptor then usesInvocationContext#getTarget()
to obtain an instance ofSimpleBean
and invokesgetId()
again.Correct me if I am wrong, but I couldn't find any evidence in CDI or Interceptors specs that would imply recursive interception is supported or even supposed to work. Now, I am not for or against that feature but if we want it, it should have it's own clear definition in either spec and its dedicated TCK test.
Note that the exact same test goal can be achieved without use of recursive interception (for instance a static field in the interceptor and comparing the two instances?). Therefore, we should be able to tweak the test to avoid recursive interception invocations without losing any coverage.
The text was updated successfully, but these errors were encountered: