Update to Mockito 3

Issue gh-611
This commit is contained in:
Josh Cummings
2022-01-11 13:09:00 -07:00
parent bfe92530c1
commit c376c57d0a

View File

@@ -21,6 +21,8 @@ import org.hamcrest.Description;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.ArgumentMatcher;
import org.springframework.LdapDataEntry;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.dao.IncorrectResultSizeDataAccessException;
@@ -1858,17 +1860,17 @@ public class LdapTemplateTest {
return controls;
}
private static class SearchControlsMatcher extends BaseMatcher<SearchControls> {
private static class SearchControlsMatcher implements ArgumentMatcher<SearchControls> {
private final SearchControls controls;
public SearchControlsMatcher(SearchControls controls) {
this.controls = controls;
}
@Override
public boolean matches(Object item) {
@Override
public boolean matches(SearchControls item) {
if (item instanceof SearchControls) {
SearchControls s1 = (SearchControls) item;
SearchControls s1 = item;
return controls.getSearchScope() == s1.getSearchScope()
&& controls.getReturningObjFlag() == s1.getReturningObjFlag()
@@ -1881,10 +1883,5 @@ public class LdapTemplateTest {
throw new IllegalArgumentException();
}
}
@Override
public void describeTo(Description description) {
description.appendText("SearchControls matches");
}
}
}