本文整理汇总了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;
}
示例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;
}
示例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();
}
示例4: markVerified
import org.mockito.invocation.Invocation; //导入方法依赖的package包/类
public void markVerified(Invocation invocation, CapturesArgumensFromInvocation wanted) {
invocation.markVerified();
wanted.captureArgumentsFrom(invocation);
}