/** * Expects any byte argument. For details, see the EasyMock documentation. * * @return {@code 0}. */ public static byte anyByte() { reportMatcher(Any.ANY); return 0; }
/** * Expects any float argument. For details, see the EasyMock documentation. * * @return {@code 0}. */ public static float anyFloat() { reportMatcher(Any.ANY); return 0; }
/** * Expects any int argument. For details, see the EasyMock documentation. * * @return {@code 0}. */ public static int anyInt() { reportMatcher(Any.ANY); return 0; }
/** * Convenience factory method that will adapt a * Hamcrest {@link org.hamcrest.Matcher} to act as an * EasyMock {@link org.easymock.IArgumentMatcher} and * report it to EasyMock so it can be kept track of. */ public static IArgumentMatcher adapt(Matcher<?> matcher) { EasyMock2Adapter easyMock2Matcher = new EasyMock2Adapter(matcher); EasyMock.reportMatcher(easyMock2Matcher); return easyMock2Matcher; }
/** * Expects a double argument greater than or equal to the given value. For * details, see the EasyMock documentation. * * @param value * the given value. * @return {@code 0}. */ public static double geq(double value) { reportMatcher(new GreaterOrEqual<>(value)); return 0; }
/** * Expects an int argument less than or equal to the given value. For * details, see the EasyMock documentation. * * @param value * the given value. * @return {@code 0}. */ public static int leq(int value) { reportMatcher(new LessOrEqual<>(value)); return 0; }
/** * Expects a double argument greater than the given value. For details, see * the EasyMock documentation. * * @param value * the given value. * @return {@code 0}. */ public static double gt(double value) { reportMatcher(new GreaterThan<>(value)); return 0; }
/** * Expects a long argument greater than the given value. For details, see * the EasyMock documentation. * * @param value * the given value. * @return {@code 0}. */ public static long gt(long value) { reportMatcher(new GreaterThan<>(value)); return 0; }
/** * Expects a string that contains the given substring. For details, see the * EasyMock documentation. * * @param substring * the substring. * @return {@code null}. */ public static String contains(String substring) { reportMatcher(new Contains(substring)); return null; }
/** * Expects a float array that is equal to the given array, i.e. it has to * have the same length, and each element has to be equal. * * @param value * the given array. * @return {@code null}. */ public static float[] aryEq(float[] value) { reportMatcher(new ArrayEquals(value)); return null; }
/** * Expects a short array that is equal to the given array, i.e. it has to * have the same length, and each element has to be equal. * * @param value * the given array. * @return {@code null}. */ public static short[] aryEq(short[] value) { reportMatcher(new ArrayEquals(value)); return null; }
/** * Expects a long argument less than or equal to the given value. For * details, see the EasyMock documentation. * * @param value * the given value. * @return {@code 0}. */ public static long leq(long value) { reportMatcher(new LessOrEqual<>(value)); return 0; }
/** * Expects a short argument greater than the given value. For details, see * the EasyMock documentation. * * @param value * the given value. * @return {@code 0}. */ public static short gt(short value) { reportMatcher(new GreaterThan<>(value)); return 0; }
/** * Expects a byte argument less than the given value. For details, see the * EasyMock documentation. * * @param value * the given value. * @return {@code 0}. */ public static byte lt(byte value) { reportMatcher(new LessThan<>(value)); return 0; }
/** * Expects a double argument less than the given value. For details, see the * EasyMock documentation. * * @param value * the given value. * @return {@code 0}. */ public static double lt(double value) { reportMatcher(new LessThan<>(value)); return 0; }
/** * Expects a byte that is equal to the given value. * * @param value * the given value. * @return {@code 0}. */ public static byte eq(byte value) { reportMatcher(new Equals(value)); return 0; }
/** * Expects a short that is equal to the given value. * * @param value * the given value. * @return {@code 0}. */ public static short eq(short value) { reportMatcher(new Equals(value)); return 0; }
/** * Expects an int array that is equal to the given array, i.e. it has to * have the same length, and each element has to be equal. * * @param value * the given array. * @return {@code null}. */ public static int[] aryEq(int[] value) { reportMatcher(new ArrayEquals(value)); return null; }
/** * Expect any boolean but captures it for later use. * * @param captured * Where the parameter is captured * @return {@code false} */ public static boolean captureBoolean(Capture<Boolean> captured) { reportMatcher(new Captures<>(captured)); return false; }
/** * Expect any char but captures it for later use. * * @param captured * Where the parameter is captured * @return {@code 0} */ public static char captureChar(Capture<Character> captured) { reportMatcher(new Captures<>(captured)); return 0; }