コード例 #1
0
 @Test
 public void testInterfaceType() throws Exception {
   DynamicType.Unloaded<?> unloaded = new ByteBuddy().redefine(InterfaceType.class).make();
   Class<?> type =
       unloaded
           .load(ClassLoadingStrategy.BOOTSTRAP_LOADER, ClassLoadingStrategy.Default.WRAPPER)
           .getLoaded();
   TypeDescription createdType = new TypeDescription.ForLoadedType(type);
   TypeDescription originalType = new TypeDescription.ForLoadedType(InterfaceType.class);
   assertThat(createdType.getTypeVariables(), is(originalType.getTypeVariables()));
   assertThat(createdType.getSuperClass(), nullValue(TypeDescription.Generic.class));
   assertThat(createdType.getInterfaces(), is(originalType.getInterfaces()));
 }