diff --git a/core/src/test/java/org/springframework/ldap/core/LdapTemplateTest.java b/core/src/test/java/org/springframework/ldap/core/LdapTemplateTest.java index c5531ca7..4b786cea 100644 --- a/core/src/test/java/org/springframework/ldap/core/LdapTemplateTest.java +++ b/core/src/test/java/org/springframework/ldap/core/LdapTemplateTest.java @@ -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 { + private static class SearchControlsMatcher implements ArgumentMatcher { 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"); - } } }