Package com.google.inject.spi

Examples of com.google.inject.spi.InterceptorBinding


        List<Element> elements = Elements.getElements(underTest);

        for (Element element : elements) {
            if (element instanceof InterceptorBinding) {
                InterceptorBinding binding = (InterceptorBinding) element;
                assertTrue(binding.getClassMatcher().matches(getClass()));
                Method method = null;
                Class<? extends Annotation> theAnnotation = null;

                for (Class<? extends Annotation> annotation : protectedMethods.keySet()) {
                    if (binding.getMethodMatcher().matches(protectedMethods.get(annotation))) {
                        method = protectedMethods.get(annotation);
                        theAnnotation = annotation;
                        protectedMethods.remove(annotation);
                        break;
                    }
                }

                if (method == null) {
                    fail("Did not expect interceptor binding " + binding.getInterceptors());
                }

                List<MethodInterceptor> interceptors = binding.getInterceptors();
                assertEquals(1, interceptors.size());
                assertTrue(interceptors.get(0) instanceof AopAllianceMethodInterceptorAdapter);
                assertTrue(interceptorTypes.get(theAnnotation).isInstance(((AopAllianceMethodInterceptorAdapter) interceptors.get(0)).shiroInterceptor));

            }
View Full Code Here

TOP

Related Classes of com.google.inject.spi.InterceptorBinding

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.