@Test public void testOnConfiguredWhenLegacyUsersFileProvidedAndFlowHasNoPorts() throws Exception { properties = mock(NiFiProperties.class); when(properties.getRestoreDirectory()).thenReturn(restoreAuthorizations.getParentFile()); when(properties.getFlowConfigurationFile()).thenReturn(flowNoPorts); when(configurationContext.getProperty(Mockito.eq(FileAuthorizer.PROP_LEGACY_AUTHORIZED_USERS_FILE))) .thenReturn(new StandardPropertyValue("src/test/resources/authorized-users.xml", null)); writeFile(primaryAuthorizations, EMPTY_AUTHORIZATIONS_CONCISE); writeFile(primaryTenants, EMPTY_TENANTS_CONCISE); authorizer.onConfigured(configurationContext); boolean foundDataTransferPolicy = false; for (AccessPolicy policy : authorizer.getAccessPolicies()) { if (policy.getResource().contains(ResourceType.DataTransfer.name())) { foundDataTransferPolicy = true; break; } } assertFalse(foundDataTransferPolicy); }
@Override public Set<AccessPolicy> getAccessPolicies() throws AuthorizationAccessException { return accessPolicyProvider.getAccessPolicies(); }
FileAuthorizer extends AbstractPolicyBasedAuthorizer { @Override public Set<AccessPolicy> getAccessPolicies() throws AuthorizationAccessException { return accessPolicyProvider.getAccessPolicies(); } }
FileAuthorizer extends AbstractPolicyBasedAuthorizer { @Override public Set<AccessPolicy> getAccessPolicies() throws AuthorizationAccessException { return accessPolicyProvider.getAccessPolicies(); }  }
FileAuthorizer extends AbstractPolicyBasedAuthorizer { @Override public Set<AccessPolicy> getAccessPolicies() throws AuthorizationAccessException { return accessPolicyProvider.getAccessPolicies(); }  @Override void initialize(final AuthorizerInitializationContext initializationContext); @Override void doOnConfigured(final AuthorizerConfigurationContext configurationContext); @Override void preDestruction(); @Override synchronized Group doAddGroup(Group group); @Override Group getGroup(String identifier); @Override synchronized Group doUpdateGroup(Group group); @Override synchronized Group deleteGroup(Group group); @Override Set<Group> getGroups(); @Override synchronized User doAddUser(final User user); @Override User getUser(final String identifier); @Override User getUserByIdentity(final String identity); @Override synchronized User doUpdateUser(final User user); @Override synchronized User deleteUser(final User user); @Override Set<User> getUsers(); @Override synchronized AccessPolicy doAddAccessPolicy(final AccessPolicy accessPolicy); @Override AccessPolicy getAccessPolicy(final String identifier); @Override synchronized AccessPolicy updateAccessPolicy(final AccessPolicy accessPolicy); @Override synchronized AccessPolicy deleteAccessPolicy(final AccessPolicy accessPolicy); @Override Set<AccessPolicy> getAccessPolicies(); @AuthorizerContext void setNiFiProperties(NiFiProperties properties); @Override synchronized UsersAndAccessPolicies getUsersAndAccessPolicies(); }
FileAuthorizer extends AbstractPolicyBasedAuthorizer { @Override public Set<AccessPolicy> getAccessPolicies() throws AuthorizationAccessException { return accessPolicyProvider.getAccessPolicies(); }  @Override void initialize(final AuthorizerInitializationContext initializationContext); @Override void doOnConfigured(final AuthorizerConfigurationContext configurationContext); @Override void preDestruction(); @Override synchronized Group doAddGroup(Group group); @Override Group getGroup(String identifier); @Override synchronized Group doUpdateGroup(Group group); @Override synchronized Group deleteGroup(Group group); @Override Set<Group> getGroups(); @Override synchronized User doAddUser(final User user); @Override User getUser(final String identifier); @Override User getUserByIdentity(final String identity); @Override synchronized User doUpdateUser(final User user); @Override synchronized User deleteUser(final User user); @Override Set<User> getUsers(); @Override synchronized AccessPolicy doAddAccessPolicy(final AccessPolicy accessPolicy); @Override AccessPolicy getAccessPolicy(final String identifier); @Override synchronized AccessPolicy updateAccessPolicy(final AccessPolicy accessPolicy); @Override synchronized AccessPolicy deleteAccessPolicy(final AccessPolicy accessPolicy); @Override Set<AccessPolicy> getAccessPolicies(); @AuthorizerContext void setNiFiProperties(NiFiProperties properties); @Override synchronized UsersAndAccessPolicies getUsersAndAccessPolicies();  }