Skip to content

Commit

Permalink
Deprecate MockitoHamcrest (mockito#1819)
Browse files Browse the repository at this point in the history
This class was used during the migration period from Mockito 1 and
Mockito 2, but is no longer necessary. To be able to remove our
dependency on Hamcrest, we should remove MockitoHamcrest.
  • Loading branch information
TimvdLippe authored and epeee committed Jun 22, 2020
1 parent 3b66dd7 commit 16d1e0d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/org/mockito/hamcrest/MockitoHamcrest.java
Expand Up @@ -44,7 +44,10 @@
* If you have an idea how to fix the problem, let us know via the mailing list or the issue tracker.
*
* @since 2.1.0
*
* @deprecated Use the regular {@link org.mockito.ArgumentMatchers#argThat(ArgumentMatcher)} instead
*/
@Deprecated
public class MockitoHamcrest {

/**
Expand All @@ -55,7 +58,9 @@ public class MockitoHamcrest {
* @param matcher decides whether argument matches
* @return <code>null</code> or default value for primitive (0, false, etc.)
* @since 2.1.0
* @deprecated Use {@link org.mockito.ArgumentMatchers#argThat(ArgumentMatcher)} instead
*/
@Deprecated
@SuppressWarnings("unchecked")
public static <T> T argThat(Matcher<T> matcher) {
reportMatcher(matcher);
Expand All @@ -70,7 +75,9 @@ public static <T> T argThat(Matcher<T> matcher) {
*
* @param matcher decides whether argument matches
* @return <code>0</code>.
* @deprecated Use {@link org.mockito.ArgumentMatchers#charThat(ArgumentMatcher)} instead
*/
@Deprecated
public static char charThat(Matcher<Character> matcher) {
reportMatcher(matcher);
return 0;
Expand All @@ -84,7 +91,9 @@ public static char charThat(Matcher<Character> matcher) {
*
* @param matcher decides whether argument matches
* @return <code>false</code>.
* @deprecated Use {@link org.mockito.ArgumentMatchers#booleanThat(ArgumentMatcher)} instead
*/
@Deprecated
public static boolean booleanThat(Matcher<Boolean> matcher) {
reportMatcher(matcher);
return false;
Expand All @@ -98,7 +107,9 @@ public static boolean booleanThat(Matcher<Boolean> matcher) {
*
* @param matcher decides whether argument matches
* @return <code>0</code>.
* @deprecated Use {@link org.mockito.ArgumentMatchers#byteThat(ArgumentMatcher)} instead
*/
@Deprecated
public static byte byteThat(Matcher<Byte> matcher) {
reportMatcher(matcher);
return 0;
Expand All @@ -112,7 +123,9 @@ public static byte byteThat(Matcher<Byte> matcher) {
*
* @param matcher decides whether argument matches
* @return <code>0</code>.
* @deprecated Use {@link org.mockito.ArgumentMatchers#shortThat(ArgumentMatcher)} instead
*/
@Deprecated
public static short shortThat(Matcher<Short> matcher) {
reportMatcher(matcher);
return 0;
Expand All @@ -126,7 +139,9 @@ public static short shortThat(Matcher<Short> matcher) {
*
* @param matcher decides whether argument matches
* @return <code>0</code>.
* @deprecated Use {@link org.mockito.ArgumentMatchers#intThat(ArgumentMatcher)} instead
*/
@Deprecated
public static int intThat(Matcher<Integer> matcher) {
reportMatcher(matcher);
return 0;
Expand All @@ -140,7 +155,9 @@ public static int intThat(Matcher<Integer> matcher) {
*
* @param matcher decides whether argument matches
* @return <code>0</code>.
* @deprecated Use {@link org.mockito.ArgumentMatchers#longThat(ArgumentMatcher)} instead
*/
@Deprecated
public static long longThat(Matcher<Long> matcher) {
reportMatcher(matcher);
return 0;
Expand All @@ -154,7 +171,9 @@ public static long longThat(Matcher<Long> matcher) {
*
* @param matcher decides whether argument matches
* @return <code>0</code>.
* @deprecated Use {@link org.mockito.ArgumentMatchers#floatThat(ArgumentMatcher)} instead
*/
@Deprecated
public static float floatThat(Matcher<Float> matcher) {
reportMatcher(matcher);
return 0;
Expand All @@ -168,7 +187,9 @@ public static float floatThat(Matcher<Float> matcher) {
*
* @param matcher decides whether argument matches
* @return <code>0</code>.
* @deprecated Use {@link org.mockito.ArgumentMatchers#doubleThat(ArgumentMatcher)} instead
*/
@Deprecated
public static double doubleThat(Matcher<Double> matcher) {
reportMatcher(matcher);
return 0;
Expand Down

0 comments on commit 16d1e0d

Please sign in to comment.