示例#1
0
 @Override
 @Before
 public void setUp() throws Exception {
   super.setUp();
   when(target.getType()).thenReturn(targetType);
   when(annotation.strategy()).thenReturn(instantiation);
   when(instantiation.proxyFor(targetType, implementationTarget, annotationDescription))
       .thenReturn(stackManipulation);
   when(annotation.constructorParameters()).thenReturn(new Class<?>[0]);
   when(targetType.asErasure()).thenReturn(targetType);
 }
 @Override
 @Before
 @SuppressWarnings("unchecked")
 public void setUp() throws Exception {
   super.setUp();
   when(firstSourceType.getStackSize()).thenReturn(StackSize.SINGLE);
   when(secondSourceType.getStackSize()).thenReturn(StackSize.SINGLE);
   when(componentType.asErasure()).thenReturn(rawComponentType);
   when(targetType.getComponentType()).thenReturn(componentType);
   when(targetType.asErasure()).thenReturn(rawTargetType);
   when(firstSourceType.asGenericType()).thenReturn(firstSourceType);
   when(firstSourceType.accept(any(TypeDescription.Generic.Visitor.class)))
       .thenReturn(firstSourceType);
   when(secondSourceType.asGenericType()).thenReturn(secondSourceType);
   when(secondSourceType.accept(any(TypeDescription.Generic.Visitor.class)))
       .thenReturn(secondSourceType);
 }