CaptorAnnotationProcessor.java 文件源码

java
阅读 23 收藏 0 点赞 0 评论 0

项目:astor 作者:
public Object process(Captor annotation, Field field) {
    Class<?> type = field.getType();
    if (!ArgumentCaptor.class.isAssignableFrom(type)) {
        throw new MockitoException("@Captor field must be of the type ArgumentCaptor.\n" + "Field: '"
           + field.getName() + "' has wrong type\n"
           + "For info how to use @Captor annotations see examples in javadoc for MockitoAnnotations class.");
    }
    Class cls = new GenericMaster().getGenericType(field);
    return ArgumentCaptor.forClass(cls);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号