private void validateDecorator(Decorator<?> decorator) { Set<Annotation> qualifiers = decorator.getDelegateQualifiers(); if (decorator.getDelegateType() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDelegateType", decorator); } Bindings.validateQualifiers( qualifiers, getBeanManager(), decorator, "Decorator.getDelegateQualifiers"); if (decorator.getDecoratedTypes() == null) { throw BeanLogger.LOG.decoratorMethodReturnsNull("getDecoratedTypes", decorator); } }
@Test(groups = INTEGRATION) @SpecAssertions({ @SpecAssertion(section = DECORATOR_INVOCATION, id = "acj"), @SpecAssertion(section = DECORATOR_RESOLUTION, id = "aa") }) public void testDecoratorIsResolved() { List<Decorator<?>> decorators = getCurrentManager().resolveDecorators(Collections.<Type>singleton(HttpSession.class)); assertEquals(2, decorators.size()); for (Decorator<?> decorator : decorators) { assertEquals(decorator.getDecoratedTypes(), Collections.<Type>singleton(HttpSession.class)); assertEquals(decorator.getDelegateType(), HttpSession.class); } }