@Test public void testDynamicInstantiation() { AuditConfig auditConfig = givenConfigHasAllowAllAuthorizer(); IAuthorizer authorizer = AuditAuthorizer.newWrappedAuthorizer(auditConfig); assertThat(authorizer).isInstanceOf(AllowAllAuthorizer.class); }
@VisibleForTesting static IAuthorizer newWrappedAuthorizer(AuditConfig auditConfig) { String authorizerName = auditConfig.getWrappedAuthorizer(); return FBUtilities.newAuthorizer(authorizerName); }
AuditAuthorizer implements IAuthorizer { @VisibleForTesting static IAuthorizer newWrappedAuthorizer(AuditConfig auditConfig) { String authorizerName = auditConfig.getWrappedAuthorizer(); return FBUtilities.newAuthorizer(authorizerName); } }
AuditAuthorizer implements IAuthorizer { @VisibleForTesting static IAuthorizer newWrappedAuthorizer(AuditConfig auditConfig) { String authorizerName = auditConfig.getWrappedAuthorizer(); return FBUtilities.newAuthorizer(authorizerName); } AuditAuthorizer(); @VisibleForTesting  AuditAuthorizer(IAuthorizer wrappedAuthorizer); }
AuditAuthorizer implements IAuthorizer { @VisibleForTesting static IAuthorizer newWrappedAuthorizer(AuditConfig auditConfig) { String authorizerName = auditConfig.getWrappedAuthorizer(); return FBUtilities.newAuthorizer(authorizerName); } 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 { @VisibleForTesting static IAuthorizer newWrappedAuthorizer(AuditConfig auditConfig) { String authorizerName = auditConfig.getWrappedAuthorizer(); return FBUtilities.newAuthorizer(authorizerName); } 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();  }