diff --git a/acl/src/test/java/org/springframework/security/acls/AclPermissionEvaluatorTests.java b/acl/src/test/java/org/springframework/security/acls/AclPermissionEvaluatorTests.java index e37a64e299..6fc6ebf4e4 100644 --- a/acl/src/test/java/org/springframework/security/acls/AclPermissionEvaluatorTests.java +++ b/acl/src/test/java/org/springframework/security/acls/AclPermissionEvaluatorTests.java @@ -26,6 +26,8 @@ import org.springframework.security.acls.model.Acl; import org.springframework.security.acls.model.AclService; import org.springframework.security.acls.model.ObjectIdentity; import org.springframework.security.acls.model.ObjectIdentityRetrievalStrategy; +import org.springframework.security.acls.model.Permission; +import org.springframework.security.acls.model.Sid; import org.springframework.security.acls.model.SidRetrievalStrategy; import org.springframework.security.core.Authentication; @@ -37,7 +39,6 @@ import org.springframework.security.core.Authentication; public class AclPermissionEvaluatorTests { @Test - @SuppressWarnings("unchecked") public void hasPermissionReturnsTrueIfAclGrantsPermission() throws Exception { AclService service = mock(AclService.class); AclPermissionEvaluator pe = new AclPermissionEvaluator(service); @@ -48,8 +49,8 @@ public class AclPermissionEvaluatorTests { pe.setSidRetrievalStrategy(mock(SidRetrievalStrategy.class)); Acl acl = mock(Acl.class); - when(service.readAclById(any(ObjectIdentity.class), anyList())).thenReturn(acl); - when(acl.isGranted(anyList(), anyList(), eq(false))).thenReturn(true); + when(service.readAclById(any(ObjectIdentity.class), anyListOf(Sid.class))).thenReturn(acl); + when(acl.isGranted(anyListOf(Permission.class), anyListOf(Sid.class), eq(false))).thenReturn(true); assertThat(pe.hasPermission(mock(Authentication.class), new Object(), "READ")).isTrue(); } @@ -68,8 +69,8 @@ public class AclPermissionEvaluatorTests { pe.setSidRetrievalStrategy(mock(SidRetrievalStrategy.class)); Acl acl = mock(Acl.class); - when(service.readAclById(any(ObjectIdentity.class), anyList())).thenReturn(acl); - when(acl.isGranted(anyList(), anyList(), eq(false))).thenReturn(true); + when(service.readAclById(any(ObjectIdentity.class), anyListOf(Sid.class))).thenReturn(acl); + when(acl.isGranted(anyListOf(Permission.class), anyListOf(Sid.class), eq(false))).thenReturn(true); assertThat(pe.hasPermission(mock(Authentication.class), new Object(), "write")).isTrue();