@Test public void testListDelegation() { Set<PermissionDetails> expectedDetails = givenPermissionDetails(mockAuthorizer); Set<PermissionDetails> actualDetails = authorizer.list(mockPerformer, permissions, mockResource, mockRole); assertThat(actualDetails).isEqualTo(expectedDetails); verify(mockAuthorizer).list(eq(mockPerformer), eq(permissions), eq(mockResource), eq(mockRole)); }
@Override public Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissionFilter, IResource resourceFilter, RoleResource roleFilter) throws RequestValidationException, RequestExecutionException { return wrappedAuthorizer.list(performer, permissionFilter, resourceFilter, roleFilter); }
AuditAuthorizer implements IAuthorizer { @Override public Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissionFilter, IResource resourceFilter, RoleResource roleFilter) throws RequestValidationException, RequestExecutionException { return wrappedAuthorizer.list(performer, permissionFilter, resourceFilter, roleFilter); } }
AuditAuthorizer implements IAuthorizer { @Override public Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissionFilter, IResource resourceFilter, RoleResource roleFilter) throws RequestValidationException, RequestExecutionException { return wrappedAuthorizer.list(performer, permissionFilter, resourceFilter, roleFilter); } AuditAuthorizer(); @VisibleForTesting  AuditAuthorizer(IAuthorizer wrappedAuthorizer); }
AuditAuthorizer implements IAuthorizer { @Override public Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissionFilter, IResource resourceFilter, RoleResource roleFilter) throws RequestValidationException, RequestExecutionException { return wrappedAuthorizer.list(performer, permissionFilter, resourceFilter, roleFilter); } AuditAuthorizer(); @VisibleForTesting  AuditAuthorizer(IAuthorizer wrappedAuthorizer); @Override Set<Permission> authorize(AuthenticatedUser user, IResource resource); @Override void grant(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, RoleResource grantee); @Override void revoke(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, RoleResource revokee); @Override Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissionFilter, IResource resourceFilter, RoleResource roleFilter); @Override void revokeAllFrom(RoleResource revokee); @Override void revokeAllOn(IResource droppedResource); @Override Set<? extends IResource> protectedResources(); @Override void validateConfiguration(); @Override void setup(); IAuthorizer getWrappedAuthorizer(); }
AuditAuthorizer implements IAuthorizer { @Override public Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissionFilter, IResource resourceFilter, RoleResource roleFilter) throws RequestValidationException, RequestExecutionException { return wrappedAuthorizer.list(performer, permissionFilter, resourceFilter, roleFilter); } AuditAuthorizer(); @VisibleForTesting  AuditAuthorizer(IAuthorizer wrappedAuthorizer); @Override Set<Permission> authorize(AuthenticatedUser user, IResource resource); @Override void grant(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, RoleResource grantee); @Override void revoke(AuthenticatedUser performer, Set<Permission> permissions, IResource resource, RoleResource revokee); @Override Set<PermissionDetails> list(AuthenticatedUser performer, Set<Permission> permissionFilter, IResource resourceFilter, RoleResource roleFilter); @Override void revokeAllFrom(RoleResource revokee); @Override void revokeAllOn(IResource droppedResource); @Override Set<? extends IResource> protectedResources(); @Override void validateConfiguration(); @Override void setup(); IAuthorizer getWrappedAuthorizer();  }