private static HandyReturnValues reportMatcher(Matcher<?> matcher) { return mockingProgress.getArgumentMatcherStorage().reportMatcher(matcher); } }
public InvocationMatcher bindMatchers(ArgumentMatcherStorage argumentMatcherStorage, final Invocation invocation) { List<LocalizedMatcher> lastMatchers = argumentMatcherStorage.pullLocalizedMatchers(); validateMatchers(invocation, lastMatchers); final InvocationMatcher invocationWithMatchers = new InvocationMatcher(invocation, (List<Matcher>)(List) lastMatchers) { @Override public String toString() { return invocation.toString(); } }; return invocationWithMatchers; }
/** * short argument that matches both given argument matchers. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the first argument matcher. * @param second * placeholder for the second argument matcher. * @return <code>0</code>. */ public static short and(short first, short second) { mockingProgress().getArgumentMatcherStorage().reportAnd(); return 0; }
/** * int argument that does not match the given argument matcher. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the argument matcher. * @return <code>0</code>. */ public static int not(int first) { mockingProgress().getArgumentMatcherStorage().reportNot(); return 0; }
/** * double argument that matches any of the given argument matchers. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the first argument matcher. * @param second * placeholder for the second argument matcher. * @return <code>0</code>. */ public static double or(double first, double second) { mockingProgress().getArgumentMatcherStorage().reportOr(); return 0; }
public void reset() { stubbingInProgress = null; verificationMode = null; getArgumentMatcherStorage().reset(); }
private void validateMostStuff() { //State is cool when GlobalConfiguration is already loaded //this cannot really be tested functionally because I cannot dynamically mess up org.mockito.configuration.MockitoConfiguration class GlobalConfiguration.validate(); if (verificationMode != null) { Location location = verificationMode.getLocation(); verificationMode = null; throw unfinishedVerificationException(location); } getArgumentMatcherStorage().validateState(); }
/** * double argument that does not match the given argument matcher. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the argument matcher. * @return <code>0</code>. */ public static double not(double first) { mockingProgress().getArgumentMatcherStorage().reportNot(); return 0; }
/** * long argument that matches any of the given argument matchers. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the first argument matcher. * @param second * placeholder for the second argument matcher. * @return <code>0</code>. */ public static long or(long first, long second) { mockingProgress().getArgumentMatcherStorage().reportOr(); return 0; }
public void reset() { stubbingInProgress = null; verificationMode = null; getArgumentMatcherStorage().reset(); }
private void validateMostStuff() { //State is cool when GlobalConfiguration is already loaded //this cannot really be tested functionally because I cannot dynamically mess up org.mockito.configuration.MockitoConfiguration class GlobalConfiguration.validate(); if (verificationMode != null) { Location location = verificationMode.getLocation(); verificationMode = null; reporter.unfinishedVerificationException(location); } getArgumentMatcherStorage().validateState(); }
/** * short argument that does not match the given argument matcher. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the argument matcher. * @return <code>0</code>. */ public static short not(short first) { mockingProgress().getArgumentMatcherStorage().reportNot(); return 0; }
/** * boolean argument that matches both given matchers. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the first argument matcher. * @param second * placeholder for the second argument matcher. * @return <code>false</code>. */ public static boolean and(boolean first, boolean second) { mockingProgress().getArgumentMatcherStorage().reportAnd(); return false; }
/** * float argument that matches any of the given argument matchers. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the first argument matcher. * @param second * placeholder for the second argument matcher. * @return <code>0</code>. */ public static float or(float first, float second) { mockingProgress().getArgumentMatcherStorage().reportOr(); return 0; }
private static HandyReturnValues reportMatcher(ArgumentMatcher<?> matcher) { return mockingProgress.getArgumentMatcherStorage().reportMatcher(matcher); } }
public InvocationMatcher bindMatchers(ArgumentMatcherStorage argumentMatcherStorage, Invocation invocation) { List<LocalizedMatcher> lastMatchers = argumentMatcherStorage.pullLocalizedMatchers(); validateMatchers(invocation, lastMatchers); List<ArgumentMatcher> matchers = new LinkedList<ArgumentMatcher>(); for (LocalizedMatcher m : lastMatchers) { matchers.add(m.getMatcher()); } return new InvocationMatcher(invocation, matchers); }
public void reset() { stubbingInProgress = null; verificationMode = null; getArgumentMatcherStorage().reset(); }
private void validateMostStuff() { //State is cool when GlobalConfiguration is already loaded //this cannot really be tested functionally because I cannot dynamically mess up org.mockito.configuration.MockitoConfiguration class GlobalConfiguration.validate(); if (verificationMode != null) { Location location = verificationMode.getLocation(); verificationMode = null; reporter.unfinishedVerificationException(location); } getArgumentMatcherStorage().validateState(); }
/** * long argument that does not match the given argument matcher. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the argument matcher. * @return <code>0</code>. */ public static long not(long first) { mockingProgress().getArgumentMatcherStorage().reportNot(); return 0; }
/** * byte argument that matches both given argument matchers. * <p> * See examples in javadoc for {@link AdditionalMatchers} class * * @param first * placeholder for the first argument matcher. * @param second * placeholder for the second argument matcher. * @return <code>0</code>. */ public static byte and(byte first, byte second) { mockingProgress().getArgumentMatcherStorage().reportAnd(); return 0; }