InterceptorResolutionService ir = new InterceptorResolutionService(getWebBeansContext());
AnnotatedType<MethodInterceptedClass> annotatedType = getBeanManager().createAnnotatedType(MethodInterceptedClass.class);
Bean<MethodInterceptedClass> bean = (Bean<MethodInterceptedClass>) getBeanManager().resolve(getBeanManager().getBeans(MethodInterceptedClass.class));
BeanInterceptorInfo interceptorInfo = ir.calculateInterceptorInfo(bean.getTypes(), bean.getQualifiers(), annotatedType);
Assert.assertNotNull(interceptorInfo);
Assert.assertNotNull(interceptorInfo.getCdiInterceptors());
Assert.assertEquals(2, interceptorInfo.getCdiInterceptors().size());
Assert.assertEquals(0, interceptorInfo.getDecorators().size());
Map<Method, BusinessMethodInterceptorInfo> methodInterceptorInfos = interceptorInfo.getBusinessMethodsInfo();
Assert.assertNotNull(methodInterceptorInfos);
Assert.assertEquals(2, methodInterceptorInfos.size());
for (Map.Entry<Method, BusinessMethodInterceptorInfo> mi : methodInterceptorInfos.entrySet())
{
if (mi.getKey().getName().equals("getMeaningOfLife"))
{
Assert.assertEquals(1, mi.getValue().getCdiInterceptors().length);
}
else if (mi.getKey().getName().equals("setMeaningOfLife"))
{
Assert.assertEquals(2, mi.getValue().getCdiInterceptors().length);
}
}
Assert.assertEquals(1, interceptorInfo.getNonInterceptedMethods().size());
shutDownContainer();
}