use of net.bytebuddy.description.annotation.AnnotationDescription in project byte-buddy by raphw.
the class ElementMatchersTest method testIsAnnotation.
@Test
public void testIsAnnotation() throws Exception {
AnnotationDescription annotationDescription = new TypeDescription.ForLoadedType(IsAnnotatedWith.class).getDeclaredAnnotations().ofType(IsAnnotatedWithAnnotation.class);
assertThat(ElementMatchers.is(IsAnnotatedWith.class.getAnnotation(IsAnnotatedWithAnnotation.class)).matches(annotationDescription), is(true));
assertThat(ElementMatchers.is(Other.class.getAnnotation(OtherAnnotation.class)).matches(annotationDescription), is(false));
}
Aggregations