use of net.bytebuddy.utility.JavaModule in project byte-buddy by raphw.
the class AgentBuilderListenerTest method testReadEdgeAddingListenerDuplexUnnamed.
@Test
public void testReadEdgeAddingListenerDuplexUnnamed() throws Exception {
Instrumentation instrumentation = mock(Instrumentation.class);
JavaModule source = mock(JavaModule.class), target = mock(JavaModule.class);
AgentBuilder.Listener listener = new AgentBuilder.Listener.ModuleReadEdgeCompleting(instrumentation, true, Collections.singleton(target));
listener.onTransformation(mock(TypeDescription.class), mock(ClassLoader.class), source, LOADED, mock(DynamicType.class));
verify(source).isNamed();
verifyNoMoreInteractions(source);
verifyZeroInteractions(target);
}
use of net.bytebuddy.utility.JavaModule in project byte-buddy by raphw.
the class AgentBuilderListenerTest method testReadEdgeAddingListenerDuplexCanRead.
@Test
public void testReadEdgeAddingListenerDuplexCanRead() throws Exception {
Instrumentation instrumentation = mock(Instrumentation.class);
JavaModule source = mock(JavaModule.class), target = mock(JavaModule.class);
when(source.isNamed()).thenReturn(true);
when(source.canRead(target)).thenReturn(true);
when(target.canRead(source)).thenReturn(true);
AgentBuilder.Listener listener = new AgentBuilder.Listener.ModuleReadEdgeCompleting(instrumentation, true, Collections.singleton(target));
listener.onTransformation(mock(TypeDescription.class), mock(ClassLoader.class), source, LOADED, mock(DynamicType.class));
verify(source).isNamed();
verify(source).canRead(target);
verifyNoMoreInteractions(source);
verify(target).canRead(source);
verifyNoMoreInteractions(target);
}
Aggregations