### Question:
DatabaseAccessPolicyProvider extends AbstractConfigurableAccessPolicyProvider { @Override public AccessPolicy getAccessPolicy(final String identifier) throws AuthorizationAccessException { Validate.notBlank(identifier); final DatabaseAccessPolicy databaseAccessPolicy = getDatabaseAcessPolicy(identifier); if (databaseAccessPolicy == null) { return null; } final Set<String> userIdentifiers = getPolicyUsers(identifier); final Set<String> groupIdentifiers = getPolicyGroups(identifier); return mapTopAccessPolicy(databaseAccessPolicy, userIdentifiers, groupIdentifiers); }  @AuthorizerContext void setDataSource(final DataSource dataSource); @AuthorizerContext void setIdentityMapper(final IdentityMapper identityMapper); @Override void doOnConfigured(final AuthorizerConfigurationContext configurationContext); @Override void preDestruction(); @Override String getFingerprint(); @Override void inheritFingerprint(String fingerprint); @Override void checkInheritability(String proposedFingerprint); @Override AccessPolicy addAccessPolicy(final AccessPolicy accessPolicy); @Override AccessPolicy updateAccessPolicy(final AccessPolicy accessPolicy); @Override Set<AccessPolicy> getAccessPolicies(); @Override AccessPolicy getAccessPolicy(final String identifier); @Override AccessPolicy getAccessPolicy(final String resourceIdentifier, RequestAction action); @Override AccessPolicy deleteAccessPolicy(final AccessPolicy accessPolicy);  }### Answer:
@Test public void testOnConfiguredWhenChangingInitialAdmin() { configure(ADMIN_USER.getIdentity(), NIFI_IDENTITIES); configure(ADMIN_USER.getIdentity(), NIFI_IDENTITIES); configure("admin2", NIFI_IDENTITIES); final AccessPolicy readBuckets = policyProvider.getAccessPolicy( ResourceFactory.getBucketsResource().getIdentifier(), RequestAction.READ); assertNotNull(readBuckets); assertEquals(5, readBuckets.getUsers().size()); assertTrue(readBuckets.getUsers().contains(ADMIN_USER.getIdentifier())); assertTrue(readBuckets.getUsers().contains(ADMIN_USER2.getIdentifier())); assertTrue(readBuckets.getUsers().contains(NIFI1_USER.getIdentifier())); assertTrue(readBuckets.getUsers().contains(NIFI2_USER.getIdentifier())); assertTrue(readBuckets.getUsers().contains(NIFI3_USER.getIdentifier())); }
@Test public void testGetPolicyByIdentifierWhenDoesNotExist() { configure(ADMIN_USER.getIdentity(), NIFI_IDENTITIES); final AccessPolicy retrievedPolicy = policyProvider.getAccessPolicy("does-not-exist"); assertNull(retrievedPolicy); }
@Test public void testGetPolicyByResourceAndActionWhenDoesNotExist() { configure(ADMIN_USER.getIdentity(), NIFI_IDENTITIES); final AccessPolicy retrievedPolicy = policyProvider.getAccessPolicy("does-not-exist", RequestAction.READ); assertNull(retrievedPolicy); }