Test case:
EXECUTE: Create CDI project
EXECUTE: Create ObserverInDecorator class
package org.test; import javax.decorator.Decorator; import javax.decorator.Delegate; import javax.enterprise.event.Observes; import javax.inject.Inject; @Decorator public class ObserverInDecorator { @Inject @Delegate @AAnnotation String str; public void method(@Observes String param){ } }
ASSERT: @Observes annotation should be marked by problem marker
EXECUTE: Point mouse to @Observes annotation
FAIL: Message is "Interceptor cannot have a method with a parameter annotated @Observes"
EXECUTE: Create ObserverInInterceptor class
package org.test; import javax.enterprise.event.Observes; import javax.interceptor.Interceptor; @Interceptor @FooBinding public class ObserverInInterceptor { public void method(@Observes String param){ } }
ASSERT: @Observes annotation should be marked by problem marker
EXECUTE: Point mouse to @Observes annotation
FAIL: Message is "Decorator cannot have a method with a parameter annotated @Observes"