use of org.springframework.stereotype.Component in project spring-framework by spring-projects.
the class MetaAnnotationUtilsTests method findAnnotationDescriptorForTypesForClassWithMetaAnnotatedInterface.
@Test
@SuppressWarnings("unchecked")
public void findAnnotationDescriptorForTypesForClassWithMetaAnnotatedInterface() {
Component rawAnnotation = AnnotationUtils.findAnnotation(ClassWithMetaAnnotatedInterface.class, Component.class);
UntypedAnnotationDescriptor descriptor;
descriptor = findAnnotationDescriptorForTypes(ClassWithMetaAnnotatedInterface.class, Service.class, Component.class, Order.class, Transactional.class);
assertNotNull(descriptor);
assertEquals(ClassWithMetaAnnotatedInterface.class, descriptor.getRootDeclaringClass());
assertEquals(Meta1.class, descriptor.getDeclaringClass());
assertEquals(rawAnnotation, descriptor.getAnnotation());
assertEquals(Meta1.class, descriptor.getComposedAnnotation().annotationType());
}
use of org.springframework.stereotype.Component in project spring-framework by spring-projects.
the class MetaAnnotationUtilsTests method findAnnotationDescriptorForClassWithMetaAnnotatedInterface.
@Test
public void findAnnotationDescriptorForClassWithMetaAnnotatedInterface() {
Component rawAnnotation = AnnotationUtils.findAnnotation(ClassWithMetaAnnotatedInterface.class, Component.class);
AnnotationDescriptor<Component> descriptor;
descriptor = findAnnotationDescriptor(ClassWithMetaAnnotatedInterface.class, Component.class);
assertNotNull(descriptor);
assertEquals(ClassWithMetaAnnotatedInterface.class, descriptor.getRootDeclaringClass());
assertEquals(Meta1.class, descriptor.getDeclaringClass());
assertEquals(rawAnnotation, descriptor.getAnnotation());
assertEquals(Meta1.class, descriptor.getComposedAnnotation().annotationType());
}
use of org.springframework.stereotype.Component in project spring-framework by spring-projects.
the class MetaAnnotationUtilsTests method findAnnotationDescriptorForTypesWithLocalAndMetaComponentAnnotation.
@Test
@SuppressWarnings("unchecked")
public void findAnnotationDescriptorForTypesWithLocalAndMetaComponentAnnotation() throws Exception {
Class<Component> annotationType = Component.class;
UntypedAnnotationDescriptor descriptor = findAnnotationDescriptorForTypes(HasLocalAndMetaComponentAnnotation.class, Transactional.class, annotationType, Order.class);
assertEquals(HasLocalAndMetaComponentAnnotation.class, descriptor.getRootDeclaringClass());
assertEquals(annotationType, descriptor.getAnnotationType());
assertNull(descriptor.getComposedAnnotation());
assertNull(descriptor.getComposedAnnotationType());
}
Aggregations