org.mockito.invocation.Invocation#markVerified ( )源码实例Demo

下面列出了org.mockito.invocation.Invocation#markVerified ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: astor   文件: InvocationBuilder.java
/**
 * 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;
}
 
源代码2 项目: yangtools   文件: ArgumentsExtractorVerifier.java
@Override
public void verify(final VerificationData data) {
    List<Invocation> actualInvocations =
        InvocationsFinder.findInvocations(data.getAllInvocations(), data.getTarget());
    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();
}
 
源代码3 项目: astor   文件: InvocationMarker.java
public void markVerified(Invocation invocation, CapturesArgumensFromInvocation wanted) {
	invocation.markVerified();
	wanted.captureArgumentsFrom(invocation);
}