当前位置: 首页>>代码示例>>Java>>正文


Java Invocation.markVerified方法代码示例

本文整理汇总了Java中org.mockito.invocation.Invocation.markVerified方法的典型用法代码示例。如果您正苦于以下问题:Java Invocation.markVerified方法的具体用法?Java Invocation.markVerified怎么用?Java Invocation.markVerified使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.mockito.invocation.Invocation的用法示例。


在下文中一共展示了Invocation.markVerified方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toInvocation

import org.mockito.invocation.Invocation; //导入方法依赖的package包/类
/**
 * Build the invocation
 *
 * If the method was not specified, use IMethods methods.
 *
 * @return invocation
 */
public Invocation toInvocation() {
    if (method == null) {
        if (argTypes == null) {
            argTypes = new LinkedList<Class<?>>();
            for (Object arg : args) {
                if (arg == null) {
                    argTypes.add(Object.class);
                } else {
                    argTypes.add(arg.getClass());
                }
            }
        }

        try {
            method = MethodsImpl.class.getMethod(methodName, argTypes.toArray(new Class[argTypes.size()]));
        } catch (Exception e) {
            throw new RuntimeException("builder only creates invocations of IMethods interface", e);
        }
    }
    
    Invocation i = new InvocationImpl(mock, new SerializableMethod(method), args, sequenceNumber, null);
    if (verified) {
        i.markVerified();
    }
    return i;
}
 
开发者ID:mockito,项目名称:mockito-cglib,代码行数:34,代码来源:InvocationBuilder.java

示例2: toInvocation

import org.mockito.invocation.Invocation; //导入方法依赖的package包/类
/**
 * Build the invocation
 *
 * If the method was not specified, use IMethods methods.
 *
 * @return invocation
 */
public Invocation toInvocation() {
    if (method == null) {
        if (argTypes == null) {
            argTypes = new LinkedList<Class<?>>();
            for (Object arg : args) {
                if (arg == null) {
                    argTypes.add(Object.class);
                } else {
                    argTypes.add(arg.getClass());
                }
            }
        }

        try {
            method = IMethods.class.getMethod(methodName, argTypes.toArray(new Class[argTypes.size()]));
        } catch (Exception e) {
            throw new RuntimeException("builder only creates invocations of IMethods interface", e);
        }
    }
    
    Invocation i = new InvocationImpl(mock, new SerializableMethod(method), args, sequenceNumber, null);
    if (verified) {
        i.markVerified();
    }
    return i;
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:34,代码来源:InvocationBuilder.java

示例3: verify

import org.mockito.invocation.Invocation; //导入方法依赖的package包/类
@Override
public void verify(final VerificationData data) {
    InvocationsFinder finder = new InvocationsFinder();
    List<Invocation> actualInvocations = finder.findInvocations(data.getAllInvocations(), data.getWanted());
    if (actualInvocations.size() != 1) {
        throw new MockitoException("This verifier can only be used with 1 invocation, got "
                + actualInvocations.size());
    }
    Invocation invocation = actualInvocations.get(0);
    arguments = invocation.getArguments();
    invocation.markVerified();

}
 
开发者ID:opendaylight,项目名称:yangtools,代码行数:14,代码来源:ArgumentsExtractorVerifier.java

示例4: markVerified

import org.mockito.invocation.Invocation; //导入方法依赖的package包/类
public void markVerified(Invocation invocation, CapturesArgumensFromInvocation wanted) {
	invocation.markVerified();
	wanted.captureArgumentsFrom(invocation);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:5,代码来源:InvocationMarker.java


注:本文中的org.mockito.invocation.Invocation.markVerified方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。