public MockeryMetadata fromParam(Class<?> mockingClass, Method method, Object[] args, int paramPosition) { Type typeParam = method.getGenericParameterTypes()[paramPosition]; Annotation[] annotationsParam = method.getParameterAnnotations()[paramPosition]; MockeryMetadata mockery = mockeryMetadata(mockingClass, method, args, typeParam, annotationsParam); return mockery; }
public MockeryMetadata fromMethod(Class<?> mockingClass, Method method, Type typeMethod, Object[] args) { Annotation[] annotationsMethod = method.getAnnotations(); MockeryMetadata mockery = mockeryMetadata(mockingClass, method, args, typeMethod, annotationsMethod); if (mockery == null) { String message = Messages .noMockeryFoundOnMethod(mockingClass, method); throw new RuntimeException(message); } return mockery; }