-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Closed
Milestone
Description
Summary
Mockito Matchers are deprecated and should be replaced with Mockito ArgumentMatcher.
Example:
public static <T> List<T> anyListOf(Class<T> clazz)
is deprecated. With Java 8 this method will be removed in Mockito 3.0. This method is only used for generic friendliness to avoid casting, this is not anymore needed in Java 8.
Deprecated because Java 8 compiler can infer the type now.
Actual Implementation, e.g.
import static org.mockito.Matchers.anyListOf;
...
lookupStrategy.readAclsById(anyListOf(ObjectIdentity.class),
anyListOf(Sid.class))).thenReturn(result);
Expected Implementation, e.g.
import static org.mockito.ArgumentMatchers.anyList;
...
lookupStrategy.readAclsById(anyList(),
anyList())).thenReturn(result);
Other example is anyObject
, which should be replaced by any
or any(Class<T> clazz)
Version
LATEST
Further details
Files affected: JdbcAclServiceTests and AclPermissionEvaluatorTests