Search in sources :

Example 1 with AbstractPolicyBasedAuthorizer

use of org.apache.nifi.authorization.AbstractPolicyBasedAuthorizer in project nifi by apache.

the class StandardFlowSerializerTest method setUp.

@Before
public void setUp() throws Exception {
    final FlowFileEventRepository flowFileEventRepo = Mockito.mock(FlowFileEventRepository.class);
    final AuditService auditService = Mockito.mock(AuditService.class);
    final Map<String, String> otherProps = new HashMap<>();
    otherProps.put(NiFiProperties.PROVENANCE_REPO_IMPLEMENTATION_CLASS, MockProvenanceRepository.class.getName());
    otherProps.put("nifi.remote.input.socket.port", "");
    otherProps.put("nifi.remote.input.secure", "");
    final NiFiProperties nifiProperties = NiFiProperties.createBasicNiFiProperties(propsFile, otherProps);
    final StringEncryptor encryptor = StringEncryptor.createEncryptor(nifiProperties);
    // use the system bundle
    systemBundle = SystemBundle.create(nifiProperties);
    ExtensionManager.discoverExtensions(systemBundle, Collections.emptySet());
    final AbstractPolicyBasedAuthorizer authorizer = new MockPolicyBasedAuthorizer();
    final VariableRegistry variableRegistry = new FileBasedVariableRegistry(nifiProperties.getVariableRegistryPropertiesPaths());
    final BulletinRepository bulletinRepo = Mockito.mock(BulletinRepository.class);
    controller = FlowController.createStandaloneInstance(flowFileEventRepo, nifiProperties, authorizer, auditService, encryptor, bulletinRepo, variableRegistry, Mockito.mock(FlowRegistryClient.class));
    serializer = new StandardFlowSerializer(encryptor);
}
Also used : NiFiProperties(org.apache.nifi.util.NiFiProperties) BulletinRepository(org.apache.nifi.reporting.BulletinRepository) HashMap(java.util.HashMap) FileBasedVariableRegistry(org.apache.nifi.registry.variable.FileBasedVariableRegistry) VariableRegistry(org.apache.nifi.registry.VariableRegistry) AbstractPolicyBasedAuthorizer(org.apache.nifi.authorization.AbstractPolicyBasedAuthorizer) FlowFileEventRepository(org.apache.nifi.controller.repository.FlowFileEventRepository) MockProvenanceRepository(org.apache.nifi.provenance.MockProvenanceRepository) StringEncryptor(org.apache.nifi.encrypt.StringEncryptor) MockPolicyBasedAuthorizer(org.apache.nifi.authorization.MockPolicyBasedAuthorizer) AuditService(org.apache.nifi.admin.service.AuditService) FileBasedVariableRegistry(org.apache.nifi.registry.variable.FileBasedVariableRegistry) Before(org.junit.Before)

Aggregations

HashMap (java.util.HashMap)1 AuditService (org.apache.nifi.admin.service.AuditService)1 AbstractPolicyBasedAuthorizer (org.apache.nifi.authorization.AbstractPolicyBasedAuthorizer)1 MockPolicyBasedAuthorizer (org.apache.nifi.authorization.MockPolicyBasedAuthorizer)1 FlowFileEventRepository (org.apache.nifi.controller.repository.FlowFileEventRepository)1 StringEncryptor (org.apache.nifi.encrypt.StringEncryptor)1 MockProvenanceRepository (org.apache.nifi.provenance.MockProvenanceRepository)1 VariableRegistry (org.apache.nifi.registry.VariableRegistry)1 FileBasedVariableRegistry (org.apache.nifi.registry.variable.FileBasedVariableRegistry)1 BulletinRepository (org.apache.nifi.reporting.BulletinRepository)1 NiFiProperties (org.apache.nifi.util.NiFiProperties)1 Before (org.junit.Before)1