use of net.bytebuddy.dynamic.scaffold.TypeInitializer in project byte-buddy by raphw.
the class TypeInitializerTest method testSimpleApplication.
@Test
public void testSimpleApplication() throws Exception {
TypeInitializer typeInitializer = new TypeInitializer.Simple(byteCodeAppender);
assertThat(typeInitializer.isDefined(), is(true));
typeInitializer.apply(methodVisitor, implementationContext, methodDescription);
verify(byteCodeAppender).apply(methodVisitor, implementationContext, methodDescription);
verifyZeroInteractions(byteCodeAppender);
verifyZeroInteractions(implementationContext);
}
use of net.bytebuddy.dynamic.scaffold.TypeInitializer in project byte-buddy by raphw.
the class ImplementationContextDisabledTest method testFactoryWithTypeInitializer.
@Test(expected = IllegalStateException.class)
public void testFactoryWithTypeInitializer() throws Exception {
TypeInitializer typeInitializer = mock(TypeInitializer.class);
when(typeInitializer.isDefined()).thenReturn(true);
Implementation.Context.Disabled.Factory.INSTANCE.make(instrumentedType, mock(AuxiliaryType.NamingStrategy.class), typeInitializer, mock(ClassFileVersion.class), mock(ClassFileVersion.class));
}
Aggregations