Hello again,
After some complications I was able to set up mock tests for my
interceptor, but I have one question. Test taken from
SimpleInterceptorTest.testInterceptorModel dosn't work with my interceptor.
@Artifact
@BeansXml("beans.xml")
public class Perf4jProfiledInterceptorTest extends AbstractWeldTest {
@Test
public void testInterceptorModel()
{
InterceptorBindingModel<Perf4jProfiled> interceptorBindingModel
= new
InterceptorBindingModel<Perf4jProfiled>(Perf4jProfiled.class, new
ClassTransformer(new TypeStore()));
Set<Annotation> annotations =
interceptorBindingModel.getInheritedInterceptionBindingTypes();
Assert.assertTrue(annotations.size() != 0);
}
}
It's not a big problem for me, but
getInheritedInterceptionBindingTypes() returns empty set. I looked into
code of using classes and I suspect that something is not initialized. I
curious what I did wrong?
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@InterceptorBinding
public @interface Perf4jProfiled {
}
Proper beans.xml has my interceptor defined.
Regards
Marcin