use of net.bytebuddy.dynamic.ClassFileLocator in project byte-buddy by raphw.
the class TypePoolDefaultWithLazyResolutionTypeDescriptionTest method testReferencedTypeIsLazy.
@Test
public void testReferencedTypeIsLazy() throws Exception {
ClassFileLocator classFileLocator = spy(ClassFileLocator.ForClassLoader.ofClassPath());
TypePool typePool = TypePool.Default.WithLazyResolution.of(classFileLocator);
TypePool.Resolution resolution = typePool.describe(String.class.getName());
assertThat(resolution.resolve().getName(), CoreMatchers.is(TypeDescription.STRING.getName()));
assertThat(resolution.resolve().getSuperClass().asErasure().getName(), CoreMatchers.is(TypeDescription.OBJECT.getName()));
verify(classFileLocator).locate(String.class.getName());
verifyNoMoreInteractions(classFileLocator);
}
Aggregations