use of org.apache.nifi.registry.flow.FlowPersistenceProvider in project nifi-registry by apache.
the class TestStandardProviderFactory method testGetProvidersSuccess.
@Test
public void testGetProvidersSuccess() {
final NiFiRegistryProperties props = new NiFiRegistryProperties();
props.setProperty(NiFiRegistryProperties.PROVIDERS_CONFIGURATION_FILE, "src/test/resources/provider/providers-good.xml");
final ExtensionManager extensionManager = Mockito.mock(ExtensionManager.class);
when(extensionManager.getExtensionClassLoader(any(String.class))).thenReturn(this.getClass().getClassLoader());
final ProviderFactory providerFactory = new StandardProviderFactory(props, extensionManager);
providerFactory.initialize();
final FlowPersistenceProvider flowPersistenceProvider = providerFactory.getFlowPersistenceProvider();
assertNotNull(flowPersistenceProvider);
final MockFlowPersistenceProvider mockFlowProvider = (MockFlowPersistenceProvider) flowPersistenceProvider;
assertNotNull(mockFlowProvider.getProperties());
assertEquals("flow foo", mockFlowProvider.getProperties().get("Flow Property 1"));
assertEquals("flow bar", mockFlowProvider.getProperties().get("Flow Property 2"));
}
use of org.apache.nifi.registry.flow.FlowPersistenceProvider in project nifi-registry by apache.
the class TestRegistryService method setup.
@Before
public void setup() {
metadataService = mock(MetadataService.class);
flowPersistenceProvider = mock(FlowPersistenceProvider.class);
snapshotSerializer = mock(VersionedProcessGroupSerializer.class);
final ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
validator = validatorFactory.getValidator();
registryService = new RegistryService(metadataService, flowPersistenceProvider, snapshotSerializer, validator);
}
Aggregations