1 /* 2 * Copyright (c) 2007 Mockito contributors 3 * This program is made available under the terms of the MIT License. 4 */ 5 package org.mockito.internal.invocation; 6 7 import org.mockito.internal.verification.api.InOrderContext; 8 import org.mockito.invocation.Invocation; 9 import org.mockito.invocation.MatchableInvocation; 10 11 import java.util.List; 12 13 public class InvocationMarker { 14 InvocationMarker()15 private InvocationMarker(){} 16 markVerified(List<Invocation> invocations, MatchableInvocation wanted)17 public static void markVerified(List<Invocation> invocations, MatchableInvocation wanted) { 18 for (Invocation invocation : invocations) { 19 markVerified(invocation, wanted); 20 } 21 } 22 markVerified(Invocation invocation, MatchableInvocation wanted)23 public static void markVerified(Invocation invocation, MatchableInvocation wanted) { 24 invocation.markVerified(); 25 wanted.captureArgumentsFrom(invocation); 26 } 27 markVerifiedInOrder(List<Invocation> chunk, MatchableInvocation wanted, InOrderContext context)28 public static void markVerifiedInOrder(List<Invocation> chunk, MatchableInvocation wanted, InOrderContext context) { 29 markVerified(chunk, wanted); 30 31 for (Invocation i : chunk) { 32 context.markVerified(i); 33 } 34 } 35 } 36