Search in sources :

Example 1 with AnnotationList

use of net.bytebuddy.description.annotation.AnnotationList in project byte-buddy by raphw.

the class TypeDescriptionForPackageDescriptionTest method testAnnotations.

@Test
public void testAnnotations() throws Exception {
    AnnotationList annotationList = mock(AnnotationList.class);
    when(packageDescription.getDeclaredAnnotations()).thenReturn(annotationList);
    assertThat(typeDescription.getDeclaredAnnotations(), is(annotationList));
}
Also used : AnnotationList(net.bytebuddy.description.annotation.AnnotationList) Test(org.junit.Test)

Example 2 with AnnotationList

use of net.bytebuddy.description.annotation.AnnotationList in project byte-buddy by raphw.

the class MethodDescriptionLatentTest method testTypeInitializer.

@Test
public void testTypeInitializer() throws Exception {
    TypeDescription typeDescription = mock(TypeDescription.class);
    MethodDescription.InDefinedShape typeInitializer = new MethodDescription.Latent.TypeInitializer(typeDescription);
    assertThat(typeInitializer.getDeclaringType(), is(typeDescription));
    assertThat(typeInitializer.getReturnType(), is(TypeDescription.Generic.VOID));
    assertThat(typeInitializer.getParameters(), is((ParameterList<ParameterDescription.InDefinedShape>) new ParameterList.Empty<ParameterDescription.InDefinedShape>()));
    assertThat(typeInitializer.getExceptionTypes(), is((TypeList.Generic) new TypeList.Generic.Empty()));
    assertThat(typeInitializer.getDeclaredAnnotations(), is((AnnotationList) new AnnotationList.Empty()));
    assertThat(typeInitializer.getModifiers(), is(MethodDescription.TYPE_INITIALIZER_MODIFIER));
}
Also used : TypeDescription(net.bytebuddy.description.type.TypeDescription) AnnotationList(net.bytebuddy.description.annotation.AnnotationList) Test(org.junit.Test)

Aggregations

AnnotationList (net.bytebuddy.description.annotation.AnnotationList)2 Test (org.junit.Test)2 TypeDescription (net.bytebuddy.description.type.TypeDescription)1