org.mockito.internal.verification.InOrderWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockito-all Show documentation
Show all versions of mockito-all Show documentation
Mock objects library for java
/*
* Copyright (c) 2007 Mockito contributors
* This program is made available under the terms of the MIT License.
*/
package org.mockito.internal.verification;
import org.mockito.internal.InOrderImpl;
import org.mockito.internal.invocation.finder.VerifiableInvocationsFinder;
import org.mockito.internal.verification.api.VerificationData;
import org.mockito.internal.verification.api.VerificationDataInOrderImpl;
import org.mockito.internal.verification.api.VerificationInOrderMode;
import org.mockito.invocation.Invocation;
import org.mockito.verification.VerificationMode;
import java.util.List;
public class InOrderWrapper implements VerificationMode {
private final VerificationInOrderMode mode;
private final InOrderImpl inOrder;
public InOrderWrapper(VerificationInOrderMode mode, InOrderImpl inOrder) {
this.mode = mode;
this.inOrder = inOrder;
}
public void verify(VerificationData data) {
List invocations = new VerifiableInvocationsFinder().find(inOrder.getMocksToBeVerifiedInOrder());
VerificationDataInOrderImpl dataInOrder = new VerificationDataInOrderImpl(inOrder, invocations, data.getWanted());
mode.verifyInOrder(dataInOrder);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy