Skip to content

Commit c376c57

Browse files
committed
Update to Mockito 3
Issue gh-611
1 parent bfe9253 commit c376c57

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

core/src/test/java/org/springframework/ldap/core/LdapTemplateTest.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import org.junit.Before;
2222
import org.junit.Test;
2323
import org.mockito.ArgumentCaptor;
24+
import org.mockito.ArgumentMatcher;
25+
2426
import org.springframework.LdapDataEntry;
2527
import org.springframework.dao.EmptyResultDataAccessException;
2628
import org.springframework.dao.IncorrectResultSizeDataAccessException;
@@ -1858,17 +1860,17 @@ private SearchControls searchControlsOneLevel() {
18581860
return controls;
18591861
}
18601862

1861-
private static class SearchControlsMatcher extends BaseMatcher<SearchControls> {
1863+
private static class SearchControlsMatcher implements ArgumentMatcher<SearchControls> {
18621864
private final SearchControls controls;
18631865

18641866
public SearchControlsMatcher(SearchControls controls) {
18651867
this.controls = controls;
18661868
}
18671869

1868-
@Override
1869-
public boolean matches(Object item) {
1870+
@Override
1871+
public boolean matches(SearchControls item) {
18701872
if (item instanceof SearchControls) {
1871-
SearchControls s1 = (SearchControls) item;
1873+
SearchControls s1 = item;
18721874

18731875
return controls.getSearchScope() == s1.getSearchScope()
18741876
&& controls.getReturningObjFlag() == s1.getReturningObjFlag()
@@ -1881,10 +1883,5 @@ public boolean matches(Object item) {
18811883
throw new IllegalArgumentException();
18821884
}
18831885
}
1884-
1885-
@Override
1886-
public void describeTo(Description description) {
1887-
description.appendText("SearchControls matches");
1888-
}
18891886
}
18901887
}

0 commit comments

Comments
 (0)