/*
* 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.verification.VerificationMode;
public class VerificationModeFactory {
public static VerificationModeatLeastOnce() {
return atLeast(1);
}
public static VerificationModeatLeast(int minNumberOfInvocations) {
return new AtLeast(minNumberOfInvocations);
}
public static VerificationModeonly() {
return new Only(); //TODO make exception message nicer
}
public static Timestimes(int wantedNumberOfInvocations) {
return new Times(wantedNumberOfInvocations);
}
public static Callscalls(int wantedNumberOfInvocations) {
return new Calls( wantedNumberOfInvocations );
}
public static NoMoreInteractionsnoMoreInteractions() {
return new NoMoreInteractions();
}
public static VerificationModeatMost(int maxNumberOfInvocations) {
return new AtMost(maxNumberOfInvocations);
}
/**
* Verification mode will prepend the specified failure message if verification fails with the given implementation.
* @param mode Implementation used for verification
* @param description The custom failure message
* @return VerificationMode
* @since 2.1.0
*/
public static VerificationModedescription(VerificationModemode, Stringdescription) {
return new Description(mode, description);
}
}