use of net.bytebuddy.implementation.bind.MethodDelegationBinder in project byte-buddy by raphw.
the class TargetMethodAnnotationDrivenBinderTest method testTerminationBinderMismatch.
@Test
public void testTerminationBinderMismatch() throws Exception {
when(targetMethod.isAccessibleTo(instrumentedType)).thenReturn(true);
when(assignmentBinding.isValid()).thenReturn(false);
when(methodInvocation.isValid()).thenReturn(true);
when(termination.isValid()).thenReturn(false);
when(targetMethod.getDeclaredAnnotations()).thenReturn(new AnnotationList.Empty());
when(firstParameter.getDeclaredAnnotations()).thenReturn(new AnnotationList.Empty());
when(secondParameter.getDeclaredAnnotations()).thenReturn(new AnnotationList.Empty());
MethodDelegationBinder methodDelegationBinder = TargetMethodAnnotationDrivenBinder.of(Collections.<TargetMethodAnnotationDrivenBinder.ParameterBinder<?>>emptyList());
assertThat(methodDelegationBinder.compile(targetMethod).bind(implementationTarget, sourceMethod, terminationHandler, methodInvoker, assigner).isValid(), is(false));
verify(terminationHandler).resolve(assigner, typing, sourceMethod, targetMethod);
verifyNoMoreInteractions(terminationHandler);
verifyZeroInteractions(assigner);
verifyZeroInteractions(methodInvoker);
}
Aggregations