|
17 | 17 |
|
18 | 18 | import static org.hamcrest.core.IsEqual.*;
|
19 | 19 | import static org.junit.Assert.*;
|
20 |
| -import static org.mockito.Matchers.*; |
| 20 | +import static org.mockito.ArgumentMatchers.*; |
21 | 21 | import static org.mockito.Mockito.*;
|
22 | 22 | import static org.springframework.data.domain.Example.*;
|
23 | 23 |
|
|
43 | 43 | import org.junit.Test;
|
44 | 44 | import org.junit.rules.ExpectedException;
|
45 | 45 | import org.junit.runner.RunWith;
|
46 |
| -import org.mockito.Matchers; |
| 46 | +import org.mockito.ArgumentMatchers; |
47 | 47 | import org.mockito.Mock;
|
48 |
| -import org.mockito.runners.MockitoJUnitRunner; |
| 48 | +import org.mockito.junit.MockitoJUnitRunner; |
49 | 49 | import org.springframework.data.domain.Example;
|
50 | 50 | import org.springframework.data.domain.ExampleMatcher;
|
51 | 51 | import org.springframework.util.ObjectUtils;
|
|
57 | 57 | * @author Mark Paluch
|
58 | 58 | * @author Oliver Gierke
|
59 | 59 | */
|
60 |
| -@RunWith(MockitoJUnitRunner.class) |
| 60 | +@RunWith(MockitoJUnitRunner.Silent.class) |
61 | 61 | @SuppressWarnings({ "rawtypes", "unchecked" })
|
62 | 62 | public class QueryByExamplePredicateBuilderUnitTests {
|
63 | 63 |
|
@@ -112,8 +112,8 @@ public void setUp() {
|
112 | 112 |
|
113 | 113 | doReturn(expressionMock).when(cb).literal(any(Boolean.class));
|
114 | 114 | doReturn(truePredicate).when(cb).isTrue(eq(expressionMock));
|
115 |
| - doReturn(andPredicate).when(cb).and(Matchers.<Predicate>anyVararg()); |
116 |
| - doReturn(orPredicate).when(cb).or(Matchers.<Predicate>anyVararg()); |
| 115 | + doReturn(andPredicate).when(cb).and(ArgumentMatchers.any()); |
| 116 | + doReturn(orPredicate).when(cb).or(ArgumentMatchers.any()); |
117 | 117 | }
|
118 | 118 |
|
119 | 119 | @Test(expected = IllegalArgumentException.class) // DATAJPA-218
|
@@ -184,7 +184,7 @@ public void orConcatenatesPredicatesIfMatcherSpecifies() {
|
184 | 184 |
|
185 | 185 | assertThat(QueryByExamplePredicateBuilder.getPredicate(root, cb, example), equalTo(orPredicate));
|
186 | 186 |
|
187 |
| - verify(cb, times(1)).or(Matchers.<Predicate>anyVararg()); |
| 187 | + verify(cb, times(1)).or(ArgumentMatchers.any()); |
188 | 188 | }
|
189 | 189 |
|
190 | 190 | static class Person {
|
|
0 commit comments